This example shows how you can send your GPS Location to the IoT Core Service on Google. This example was done to show case PixieBoards capabilities.
$ sudo git clone --recurse-submodules https://github.com/pixierepo/PixieBoardIoTCoreExample.gitAfter you have downloaded the repo you should install the python dependencies with:
$ sudo pip install -r requirements.txtBefore you start you should already have the PixieBoards modem enabled. You can do that by typing:
$ sudo enablePixieModemWait around 30 seconds and then check with this command:
$ mmcli -L
output: Found 1 modems:
/org/freedesktop/ModemManager1/Modem/0 [QUALCOMM INCORPORATED] QUECTEL Mobile Broadband ModuleIf so you can start using the PixieBoardGPSLocation class.
If you are not familiar with the information above I recommend you take a look at our Medium page that has a Getting Started Guide and a Enable PixieBoards Modem guide.
You should have base-devel, python, pip and socat installed:
$ sudo pacman -S base-devel python, python-pip socatAssuming you have already generated the registry on the Google Cloud Console and the private and public keys here is an example on how to execute the file:
$ sudo python MQTTExample.py --registry_id=<registry_id> --cloud_region=<cloud-region> --project_id=<project_id> --device_id=<device_id> --algorithm=RS256 --private_key_file=<private_key.pem> --num_messages 10If you are not familiar with the above take a look at this guide that show to set up the cloud enviornment: PixieBoard + Google's IoT Core