I am running zerynth version r2.1.2 on Arch linux x86_68 kernel version 4.18.12-arch1-1-ARCH and I’m currently facing a problem which is that whenever I try to compile the Wifi_scan example for my nodemcu v2 board I get the following error:
Error in C natives [---] in [[/home/ale/.zerynth2/dist/r2.1.2/libs/official/espressif/esp8266wifi/csrc/wifi_ifc.c] at line 0]
Digging further I found a topic created on May 24 addressing the same issue, saying that it is a problem with the compiler.
Trying to manually compile wifi_ifc.c with xtensa-l016-elf-gcc resulted in error:
/home/ale/.zerynth2/dist/r2.1.1/libs/official/espressif/esp8266wifi/csrc/wifi_ifc.c:1:21: fatal error: zerynth.h: No such file or directory #include "zerynth.h"
The code I’m trying to compile is:
# import streams & socket import streams import socket # import the wifi interface from wireless import wifi # the wifi module needs a networking driver to be loaded # in order to control the board hardware. # FOR THIS EXAMPLE TO WORK, A NETWORK DRIVER MUST BE SELECTED BELOW from espressif.esp8266wifi import esp8266wifi as wifi_driver streams.serial() # init the wifi driver! # The driver automatically registers itself to the wifi interface # with the correct configuration for the selected board wifi_driver.auto_init() # a list of security strings wifi_sec=["Open","WEP","WPA","WPA2"] try: print("Scanning for 15 seconds...") # start scanning for 15000 milliseconds res = wifi.scan(15000) # if everything goes well, res is a sequence of tuples # each tuple contains: # -ssid: the name of the network # -sec: the security type of the network, from 0 to 3 # -rssi: the strength of the signal, from 0 to 127 # -bssid: the mac address of the access point for ssid,sec,rssi,bssid in res: print(ssid,"::",wifi_sec[sec],":: strength ",rssi*100/127) except Exception as e: print(e)