Avatar for robins

robins

Member since Jun 2020 • Last active Jan 2025
  • 1 conversations
  • 3 comments

Canada

Most recent activity

  • in Pico / Wifi / Original Espruino
    Avatar for robins

    Hello,

    I'm having trouble getting any Wifi examples to work. I know I had similar examples working a few years ago but now when I try I have no luck. I can apply simple programs to read pins and flash LEDs but I was wanting to add more.

    https://www.espruino.com/WiFi#using-wifi

    I've simplified it to this for now with an old spare router and no password...

    var WIFI_NAME = "dlink";
    var WIFI_OPTIONS = { password : "" };
    
    var wifi = require("Wifi");
    wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
      if (err) {
        console.log("Connection error: "+err);
        return;
      }
      console.log("Connected!");
      getPage();
    });
    

    Here's the error I get once the above is uploaded to the Espruino Wifi. But I don't have 42 lines of code.

    
    Uncaught SyntaxError: Got EOF expected '}'
     at line 42 col 112
    ...cted:p,socks:f,sockData:k}}
                                  ^
    Uncaught Error: Can't read property 'connect' of undefined
     at line 5 col 5
    wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
        ^
    

    I flashed the board to 2v25 and it's an Espruino Wifi. I have verified that the Wifi module is on it.

    I have also tried to re-flash the built in ESP8266 with Chrome and the Web IDE version 0.79.10.
    This was with the built in flasher but I ran into the sync error even after trying a 2nd cable. It currently has v 0.40.0.
    Here's two images of that. Images are attached since I don't think attaching inline is working for me.

    So then I tried this method: https://www.espruino.com/WiFi#advanced-esp8266-reflashing
    This shows what I get for output from that...

    C:\Users\Owner\Downloads\espruino>esptool.py --no-stub --port COM3 --baud 74880 write_flash --flash_mode dio 0 AiThinker_ESP8266_DIO_32M_32M_20160615_V1.5.4.bin
    esptool.py v2.0
    Traceback (most recent call last):
      File "C:\Users\Owner\Downloads\espruino\esptool.py", line 2405, in <module>
        _main()
        ~~~~~^^
      File "C:\Users\Owner\Downloads\espruino\esptool.py", line 2398, in _main
        main()
        ~~~~^^
      File "C:\Users\Owner\Downloads\espruino\esptool.py", line 2117, in main
        operation_args,_,_,_ = inspect.getargspec(operation_func)
                               ^^^^^^^^^^^^^^^^^^
    AttributeError: module 'inspect' has no attribute 'getargspec'. Did you mean: 'getargs'?
    

    For this I've put the esptool.py files and bin file in the directory

    C:\Users\Owner\Downloads\espruino 
    

    and then ran this command...

    esptool.py --no-stub --port COM3 --baud 74880 write_flash --flash_mode dio 0 AiThinker_ESP8266_DIO_32M_32M_20160615_V1.5.4.bin
    

    I'm looking for suggestions of what to try next. ChatGPT can only do so much.
    Cheers,
    Robin

Actions