Apparently, the wifi client code works in the same way as the ethernet client. I made the modifications to the RFM Gateway 2.5.4 code to use the shield. The problem is that the wifi code is too big, and here on the ship, I just brought ATMega328P. The code occupies 116% of this memory and 106% of the dynamic memory. I would have to use another processor, like the MEGA2560 which has more storage space.
3 - Set up your wifi network within the sketch downloaded from the end of this sketch.
#ifdef NetworkOne // settings for Gateway 1 char ssid = "YourNetworkSSID"; // SECRET_SSID; // your network SSID (name) char pass = "XXXXXXXXXXXXXXX"; //SECRET_PASS; // your network password (use for WPA, or use as key for WEP) int keyIndex = 0; // your network key Index number (needed only for WEP) int status = WL_IDLE_STATUS;
3 - Configure the pins of the ATWINC1500
WiFi.setPins (6,5,4); // Setting pins to wifi shield. > setPins (int8_t cs, int8_t irq, int8_t rst, int8_t en = -1);
Note: RFM69HW pins have not been modified.
The test prototype:
Sorry for the appearance, but I'm on a ship and I do not have many features.
Another important point that I came across these days was the need to have to point out exactly the IP of the MQTT server. This requires IP reservation on the router's DHCP and this is not always fast. My idea is to try somehow to scan a certain IP range. Example: 192.168.10.xxx If my network is by default this range, I know that my server will be between 1 and 255, it would just try to connect me on each IP with MQTT.
If we delve deeper, with each successful connection, it would be enough to store in the eeprom and to restart for some reason the first IP to try would be stored in the eeprom, in case of X attempts, would initiate scanning routine again.