WiFi & Bluetooth

Hi

Are WiFi and Bluetooth currently working through the Ardupy IDE? It seems like we have to wait for you to add the necessary Ardupy linking library. Our current code base for our current BLE to WiFi hubs is written in Python, and it would be great if we could easily port that to the WIO Terminal using Micropython. Also, we are unable to get WiFi functionality through Arduino IDE, and we don’t know where to pose technical questions regarding that.

Good to hear from you, you’re right, we haven’t added ArduPy’s wifi/BLE library yet, and we’re also researching what interfaces are more appropriate for wifi/BLE to use. We didn’t want to reinvent a set of interfaces, being able to fit into an interface that everyone would like was what we wanted to do. What kind of API do you guys use on MicroPython for wifi/ble now, and do you think it works well? What are the recommendations in this regard?
@wernervor

1 Like

Hey Baozhu,

I work with @wernervor. We have experience with the ‘network’ module in MicroPython on the Pycom boards, which use an ESP32. Both the WiFi and BLE API through the ‘network’ module work pretty well. In the meantime, we are trying to develop using the Arduino IDE to test out the WIO Terminal, but it seems like the Seeed WiFi libraries are still under development as well. I am following the wiki, after updating the RTL8720 firmware, but still getting compile errors from the WiFi libraries.

Thank you for your help!

@MohamedElmahdy I’m glad to receive your feedback. We have been able to use WIO Terminal WiFI normally, and there are many Demo. What exactly is errors? @ansonhe97 Please help check it.

Hi @MohamedElmahdy @wernervor

Please make sure that your Seeed SAMD core is up to date:

Thank you for the reply and help @ansonhe97 and @Baozhu.

I have 1.7.2 installed. I followed your steps and opened the WiFiScan example and received this error.

Arduino: 1.8.12 (Mac OS X), Board: “Seeeduino Wio Terminal, Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off”

In file included from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/examples/WiFiScan/WiFiScan.ino:6:0:
/Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/src/AtWiFi.h:1:1: error: ‘WiFi’ does not name a type
WiFi.h
^
/Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/examples/WiFiScan/WiFiScan.ino: In function ‘void setup()’:
WiFiScan:12:5: error: ‘WiFi’ was not declared in this scope
WiFi.mode(WIFI_STA);
^
WiFiScan:12:15: error: ‘WIFI_STA’ was not declared in this scope
WiFi.mode(WIFI_STA);
^
/Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/examples/WiFiScan/WiFiScan.ino: In function ‘void loop()’:
WiFiScan:23:13: error: ‘WiFi’ was not declared in this scope
int n = WiFi.scanNetworks();
^
WiFiScan:38:55: error: ‘WIFI_AUTH_OPEN’ was not declared in this scope
Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN) ? " " : “*”);
^
exit status 1
‘WiFi’ was not declared in this scope

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

Hi @MohamedElmahdy,

After some quick debugging, we figured this is a problem due to github’s Symbolic Link:

, it did not copy itself for some reasons.

We are fixing this right now and will update all the libraries.

For now, you can use the git clone methods to redownload the libraries, and check if Seeed_Arduino_atWiFi/src/AtWifi.h is a complete file.

Hey @ansonhe97,

Thanks! That cleared up that problem. However now I get this error…

Arduino: 1.8.12 (Mac OS X), Board: “Seeeduino Wio Terminal, Enabled, 120 MHz (standard), Small (-Os) (standard), 50 MHz (standard), Arduino, Off”

In file included from /Users/mohamed/Documents/Arduino/libraries/esp-at-lib/src/esp_config.h:86:0,
from /Users/mohamed/Documents/Arduino/libraries/esp-at-lib/src/esp_at_lib.h:10,
from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atUnified/src/Seeed_atUnified.h:11,
from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/src/WiFiGeneric.h:26,
from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/src/WiFiSTA.h:28,
from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/src/AtWiFi.h:32,
from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/examples/WiFiScan/WiFiScan.ino:6:
/Users/mohamed/Documents/Arduino/libraries/esp-at-lib/src/esp/esp_config_default.h:1:1: error: expected unqualified-id before ‘.’ token
…/…/esp_at_lib/src/include/esp/esp_config_default.h
^
In file included from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atUnified/src/Seeed_atUnified.h:17:0,
from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/src/WiFiGeneric.h:26,
from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/src/WiFiSTA.h:28,
from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/src/AtWiFi.h:32,
from /Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atWiFi/examples/WiFiScan/WiFiScan.ino:6:
/Users/mohamed/Documents/Arduino/libraries/Seeed_Arduino_atUnified/src/atu_netdb.h:148:36: error: ‘esp_ip_t’ has not been declared
extern int esp_ip_2_str(char* buf, esp_ip_t ip);
^
exit status 1
Error compiling for board Seeeduino Wio Terminal.

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

I realize now that it is the same Symbolic Link problem as in the first problem. I cloned all of the WiFi related libraries listed in the wiki instead of downloading ZIP files and adding them using Arduino Add Zip Library.

I was able to build and upload the WiFiScan example. Will start messing around with this. Thanks for your help so far!

Are there libraries for Bluetooth, or is that coming soon?

We are also planning the BLE library. Do you have any suggestions? Which BLE Arduino library do you think is very good? @MohamedElmahdy

I only have experience with the ESP32 Bluetooth library on Arduino. @Baozhu

By the way, after uploading the WiFi Scan example to the WIO Terminal, I see this in the serial console with timestamps shown.

22:26:12.524 -> No ACK, R00
22:26:12.524 -> No ACK, R00
22:26:12.524 -> .No ACK, R00
22:26:12.524 -> No ACK, R00
22:26:12.524 -> No ACK, R00

This seems that you have not updated the WIFI core sucessfully, please follow this:
https://wiki.seeedstudio.com/Wio-Terminal-Network-Overview/#update-the-wireless-core-firmware

Good to hear from you, you’re right, we haven’t added ArduPy’s wifi/BLE library yet, and we’re also researching what interfaces are more appropriate for wifi/BLE to use.

Hey @ansonhe97, looks like you were right! I may have messed up in the image selection or did not have them checked in the image tool. WiFi scan works well now! Thanks for your help.

1 Like

Hello @efix_durov, thanks for the reply. So there is no option to use BLE using the Arduino IDE at the moment also? I believe that is what @Baozhu was saying, but I just wanted to make sure. Do you have an expected date when it will be available on either Arduino or ArduPy?

We tentatively set it for July and August. But BLE we can provide a list of AT commands now, and I hope someone will claim this task and we can outsource it to someone more capable. @MohamedElmahdy

Thanks for this information. I will also try a demo before downloading a full version. It is good I have discovered this thread. I am from Houston zip code location, now I will follow it for having the fresh information on updates and other helpful things. Where are you all from? It seems you are all old acquaintances, am I right? I will join your community.

Thanks @Baozhu for the expected timeline. I would love to get the list of AT commands if possible. I have some experience with cellular module AT commands, and BLE experience at a higher level, so maybe I can try to use that.

Hey @efix_durov, we are at the TMCx space. Are you familiar?

https://github.com/Seeed-Studio/seeed-ambd-sdk#at-command-list @MohamedElmahdy Please let me know if you encounter any problems during the use.