Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,29 @@ Now connecting with `curl` should fail with a similar error:
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

## Connecting QField to a local QFieldCloud instance

In order to connect the QField mobile app to your local QFieldCloud development instance, the following prerequisites must be met:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In order to connect the QField mobile app to your local QFieldCloud development instance, the following prerequisites must be met:
QFieldCloud REST API is used across clients, including the QField app.
One can test their local QFieldCloud instance by running QField on their development machine.
[Install QField](https://qfield.org/get) for your operating system.
In order to connect QField from a device different from your development machine (e.g. your mobile phone), the following prerequisites must be met:

Not sure what was the use case, but 95% of the time you better test the APIs using the desktop client, because you also have (easy) access to the configuration files. I guess it needs a bit of reordering, so in the injected paragraph above we can point to the bullet with instructions - start, type ip etc etc.


- The QFieldCloud app container's ports must be exposed on the public interface (0.0.0.0) of your dev machine
To check this, run `docker compose ps app`. It should say `0.0.0.0:8011->8000/tcp`.
- Your dev machien and your mobile phone need to be on the same network (e.g. same WiFi)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Your dev machien and your mobile phone need to be on the same network (e.g. same WiFi)
- Your dev machine and your mobile phone need to be on the same network (e.g. same WiFi)

- Find out the external IP address of the interface that the app container's HTTP port is bound to.
E.g. something like `ip -f inet addr show eth1` (make sure to pick the right interface if you have several NICs, like Ethernet and WiFi)
- For easier access via hostname, you need to have an mDNS service like avahi running on your dev machine.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- For easier access via hostname, you need to have an mDNS service like avahi running on your dev machine.
- For easier access via hostname, you need to have an mDNS service like `avahi` running on your dev machine.

On Linux, check that `avahi` is running: `systemctl status avahi-daemon`
If not, install `avahi-daemon` and make sure it's running. That should then allow you to access your dev machine as `<your-dev-machine-hostname>.local` from devices on the same network. E.g. if the hostname of your dev machine is `foo`, you should be able to reach it using `ping foo.local` from another machine on the same network.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If not, install `avahi-daemon` and make sure it's running. That should then allow you to access your dev machine as `<your-dev-machine-hostname>.local` from devices on the same network. E.g. if the hostname of your dev machine is `foo`, you should be able to reach it using `ping foo.local` from another machine on the same network.
If not, install `avahi-daemon` and make sure it's running.
That should then allow you to access your dev machine as `<your-dev-machine-hostname>.local` from devices on the same network.
E.g. if the hostname of your dev machine is `foo`, you should be able to reach it using `ping foo.local` from another machine on the same network.

We tend to add new markdown with one sentence per line for better history tracking.

- In QFieldCloud's settings, the external IP address and hostname need to be added to `DJANGO_ALLOWED_HOSTS`

This should then be enough to connect the QField mobile app to your local QFieldCloud instance:

- Start QField
- When asked to sign in, double tap on the Nyuki logo to enter a custom QFieldCloud server URL
- Enter the URL using your mDNS hostname (or IP address, if mDNS doesn't work for you):
- `http://192.168.1.x:8011/` or
- `http://<your-dev-machine-hostname>.local:8011/`


## Code style

Code style done with [`pre-commit`](https://pre-commit.com):
Expand Down
Loading