I’ve tried the http get example from the Sodaq_WifiBee library and when I call wifiBee.isAlive() it returns false. Does this mean I’m not connected to a wifi network?
There is also an isOn function but that is private. I tried the on function and I see a message Power ON in the serial monitor. Does this mean the device is on and functioning?
The WifiBee is designed to stay powered off when not in use.
The HTTPGet() method will switch on the device, connect to the network, open the TCP connection, send and receive the data before closing the connections and powering down.
If you call isAlive() it will normally return false as in most cases the device is switched off.
You can also call on() which will leave the device powered on until you call off().
I’m trying to connect to the public wifi network from Ziggo. Unfortunately, I don’t have a private network to test with at the moment. Is this supported by the WifiBee?
There were two main differences, the Serial -> SerialUSB change, and also the initialisation and switching is different on the Autonomo due to the switchable BEE_VCC.
I searched for this error and saw that a file is missing, I did flip the switch on the wifibee once when it wasn’t working but after that I put the switch back into its original position, Is this ok?
You should be ok to put the module into flash/program mode, although I probably wouldn’t do this while it is on.
You should leave it in the run/work position unless you are updating the firmware on the WifiBee module.
Those odd characters at the start up are normal. Also you can ignore the “lua: cannot open init.lua” message.
That list of |STS|1| responses are correct. However, it is timing out trying to connect to the network (code 1 = connecting). This is usually the result of incorrect AP name or password. The current timeout is set at 10 seconds, if you do need more time you can adjust WIFI_CONNECT_TIMEOUT in Sodaq_WifiBee.cpp (line 57). Value is set in milliseconds.
init.lua is the missing file. It probably doesn’t work because I try to connect to a public network. When I have a home wifi network available I will try the code again. Thanks for updating the examples. The SSID and password were correct, I checked them against the mijn Ziggo site.
A colleague suggested to use my phone as a hotspot so I tried that. When I select WPA2-PSK I get the same time out. I also increased the time out in the code but this didn’t help.
I also had the option to provide open access with no password, when I did this the example ran correctly and I got the response. I don’t know why the WPA2 is failing for me.
I checked what encryption my home router is using, it is set to WPA2-PSK.
As I haven’t run into this issue, I’m not exactly sure what could be causing it.
We could try updating/reflashing the module.
There is a tool for this available here:
If you have a USARTBee, the process will be quite straight forward.
Put the switch in program position, connect it via USB and then use the
provided tool. You will also need to jump the DTR pin to ground, as this
needs to be low for the module to switch on.
If you don’t have USARTBee, I believe it should be possible to do the
same process via a pass through sketch. I can help you with that sketch,
just let me know if you need it.
Here is a sketch that will work for updating the WifiBee firmware using an Autonomo:
void setup()
{
// Turn on BEE_VCC
pinMode(BEE_VCC, OUTPUT);
digitalWrite(BEE_VCC, HIGH);
// Turn on the WifiBee
pinMode(BEEDTR, OUTPUT);
digitalWrite(BEEDTR, LOW);
// SerialUSB is running at 115200
// Start Bee UART
Serial1.begin(115200);
}
void loop()
{
// Pass through one byte at a time
if (SerialUSB.available()) {
Serial1.write(SerialUSB.read());
}
if (Serial1.available()) {
SerialUSB.write(Serial1.read());
}
}
In the flasher tool you will need to go to the Advanced tab and set the baudrate to 115200.
(This is the baudrate of the SerialUSB connection).
Also don’t forget to move the switch on the WifiBee to “PROG”.
If you have an Mbili or another one of our boards let me know as the sketch will be slightly different.
I would recommend starting with the firmware build that comes built in with the tool.
I’ve managed to flash the wifi chip, or at least I got the green check after it was done. However, now I also get a time out when I use no password for my hotspot. I see the blue light on the wifi chip flashing once and then after some time I get the time out message.