When I call getbssid() and rssi() after the device first starts, I get the correct values. However, after an idle time (my code is based on the WeatherStation app with April and EnvTail), the value for bssid is “000000000000” and rssi is “0” until the device is restarted.
Maybe the Imp isn’t connected to wifi when you get the RSSI values. The Imp only makes a wifi connection when required. Perhaps try a server.log first as a test.
I saw the same thing! But have found a different solution…
Change the imp.onidle sleep to exit with imp.wakeup (should do the same thing)
as shown below.
If you enter sleep (server.sleepfor or imp.deepsleepfor) then when the imp wakes wifi is not connected. If your code calls rssi before it does anything to bring the wifi link up, then you’ll get zero.
eg if your first line of code is:
server.log(imp.getrssi());
…this will log zero. The rssi is fetched then the log message (which causes the link to come up) is sent. WiFi was down when imp.getrssi() was evaluated.