Particle Photon WiFi Issues


I’m trying to get my Photon to run the WiFi Scan example and I’m having a number of issues:

1. The Scan results I get using Zerynth are poor compared to using a similar program with the Particle complier and environment. Typically the number of access points returned by Zerynth is 3 whereas Particle returns 11+.

From my testing I believe I have found that the antenna is switched by Zerynth auto_init to the Photon external connector and not the Photon on-board antenna.

2. I have tried without success to use the set_antenna command. This appears to stop everything (I get no serial output) no matter what value I use (e.g wifi.set_antenna(“3” or wifi.set_antenna(3)). The documentation does not give any examples of use of this or the get_rssi or get_error commands. Perhaps I’m not using this correctly? Without adequate documentation I cannot say.

Could you:

a) confirm my testing results regarding the antenna default is it being switched away from the on board antenna and

b) clarify and improve the documentation for the BCM43362 so that I can use all of the Zerynth features.



Hello @kenr,

sorry for the late answer.

The default antenna in the auto_init is set to “3” which, in bcm43362 sdk lingo, means automatic antenna selection.

This is the very minimal documentation provided by the sdk (from my tests, antenna 0 should be the internal one)

 *    antenna = 0 -> select antenna 0
 *    antenna = 1 -> select antenna 1
 *    antenna = 3 -> enable auto antenna selection ie. automatic diversity
<div><br>Also, the scan procedure is executed in the "active" way, by sending a wifi scan probe (as opposed to the "passive" way where the scan is performed by listening to AP beacons). The scanning happens, in our implementation, only for the channels available in the selected country which by default is "US". Country code can be changed by passing the country argument to the auto_init.<br><br><br>For the set_antenna and get_rssi functions, since they are specific to each wifi driver, they are not included in the wifi module but in the driver module itself. Therefore, they should be called like this:<br><br><pre class=" CodeBlock">from broadcom.bcm43362 import bcm43362<br>from wireless import wifi<br># link to wifi network...<br>bcm43362.set_antenna(0)<br>bcm43362.get_rssi()

If you are already calling these function the right way, can you enclose them in a try/except statement and print the exception?