Arduino Primo WiFi problems

I have an Arduino Primo that I've just set up, and I'm now able to get sensor data form an I2C device, and I have the Primo added to my network -- via the built-in web configuration UI included -- but I can't seem to figure out how to have the device send the sensor data out via WiFi.

The built-in web interface has allowed me to start sending RSSI and heap size data out via MQTT, and I'd like to send the sensor data out over MQTT as well, but whenever I include the WiFi Library, I get:

/Users/davidgs/Documents/Arduino/libraries/WiFi/src/utility/spi_drv.cpp: In static member function 'static char SpiDrv::spiTransfer(char)':
/Users/davidgs/Documents/Arduino/libraries/WiFi/src/utility/spi_drv.cpp:36:79: error: 'F_CPU' was not declared in this scope
 #define DELAY_SPI(X) { int ii=0; do { asm volatile("nop"); } while (++ii < (X*F_CPU/16000000)); }
                                                                               ^
/Users/davidgs/Documents/Arduino/libraries/WiFi/src/utility/spi_drv.cpp:37:26: note: in expansion of macro 'DELAY_SPI'
 #define DELAY_TRANSFER() DELAY_SPI(10)
                          ^
/Users/davidgs/Documents/Arduino/libraries/WiFi/src/utility/spi_drv.cpp:76:5: note: in expansion of macro 'DELAY_TRANSFER'
     DELAY_TRANSFER();
     ^
/Users/davidgs/Documents/Arduino/libraries/WiFi/src/utility/spi_drv.cpp: In static member function 'static void SpiDrv::getParam(uint8_t*)':
/Users/davidgs/Documents/Arduino/libraries/WiFi/src/utility/spi_drv.cpp:36:79: error: 'F_CPU' was not declared in this scope
 #define DELAY_SPI(X) { int ii=0; do { asm volatile("nop"); } while (++ii < (X*F_CPU/16000000)); }
                                                                               ^
/Users/davidgs/Documents/Arduino/libraries/WiFi/src/utility/spi_drv.cpp:37:26: note: in expansion of macro 'DELAY_SPI'
 #define DELAY_TRANSFER() DELAY_SPI(10)
                          ^
/Users/davidgs/Documents/Arduino/libraries/WiFi/src/utility/spi_drv.cpp:148:5: note: in expansion of macro 'DELAY_TRANSFER'
     DELAY_TRANSFER();
     ^
Multiple libraries were found for "WiFi.h"
 Used: /Users/davidgs/Documents/Arduino/libraries/WiFi
 Not used: /Applications/Arduino.app/Contents/Java/libraries/WiFi
Using library WiFi at version 1.2.5 in folder: /Users/davidgs/Documents/Arduino/libraries/WiFi 
Using library SPI at version 1.0 in folder: /Users/davidgs/Library/Arduino15/packages/arduino/hardware/nrf52/1.0.2/libraries/SPI

The NRF52 is connected to the ESP wifi coprocessor via SPI, but I can find absolutely zero documentation on how to get this to work.

Any ideas??

TIA,
dg

use WiFi Link library version 1.0.1 from Library Manager.

MQTT in Primo Web Panel? I thought Primo has WiFi Link firmware in esp like here

Thanks for the tip on using WiFi Link instead of WiFi. That at least compiles without complaint.

However, I tried to run a couple of the example sketches just to see what would happen, and I consistently get

Communication with WiFi module not established.

On every one of them, so I'm still missing something.

I'll keep digging around but if you have any further suggestions, I'm all ears!

The WiFi library is written for use with the Arduino WiFi shield, which uses the HDG204. That library is not compatible with the ESP8266 (or apparently the Primo in general).

In looking through the Library code, it would appear that it is actually supposed to work with the Primo:

/*
  Web client

 This sketch connects to a website (http://www.google.com)
 using an Arduino board with WiFi Link.

 This example is written for a network using WPA encryption. For
 WEP or WPA, change the Wifi.begin() call accordingly.

 This example is written for a network using WPA encryption. For
 WEP or WPA, change the Wifi.begin() call accordingly.

 Circuit:
 * Arduino Primo or STAR OTTO or Uno WiFi Developer Edition (with WiFi Link firmware running)

 created 13 July 2010
 by dlf (Metodo2 srl)
 modified 31 May 2012
 by Tom Igoe
 modified 10 March 2017
 by Sergio Tomasello and Andrea Cannistrá
 */

Also, in the SPI driver for this library:

#define SLAVESELECT 31              // ss							      //10 uno, 31 Primo
#define SLAVEREADY  30               // handshake pin   	    //7 uno, 30 Primo

I'm still working my way through all the c++ code to try to debug this...

dg

I was talking about the WiFi library, not WiFi Link. I realize you had already moved on from the WiFi library but just wanted to clear that up as it's a common misconception.

I made improvements to WiFi Link but they change nothing for Primo on library side. And changing the esp firmware on Primo is risky.

try the improved examples