Re: Using PIC-IoT WG Development Board outside of Google cloud services
You certainly can, I've modified my board to connect to an alternative cloud provider.
Note for doing so:
- It's pretty easy to remove the code for the ATECC608A, just delete cryptauthlib from the project. There's only a few places that it's used. As my alternative cloud provider doesn't need certificate authentication, this wasn't needed.
- The core of the code that needs altering is in cloud_service.c and the logic is a bit tortuous. Look out for the covering timer - this is set to 10s, but it needs to connect to wifi, get a time from NTP and connect to MQTT in that time - I was timing out.
- Turn debug on.
- The values in the header file IoT_Sensor_Node_config.h for the MQTT host and port are also hardcoded in the code elsewhere - search for 443 and google to find where.
- I found it easiest to modify connectMQTTSocket() to not use TLS (change the line *context->tcpClientSocket = BSD_socket(PF_INET, BSD_SOCK_STREAM, 1); to take a 0 as the last parameter) to get it up and running, that way I could connect to mosquitto on a PC, and view the raw packets being transferred.