Avatar for Allen

Allen

Member since Jun 2019 • Last active Mar 2022
  • 1 conversations
  • 10 comments

Most recent activity

  • in ESP32
    Avatar for Allen

    I have an issue somewhat similar to user124799. I recently picked up a couple of MELIFE ESP32 boards because I'm having trouble obtaining Espruinio WIFI boards (so sorry Gordon!). I flashed 2v08 and ran this simple web server:

    var wifi;
    var count = 0;
    
    function getContent() {
      return '<html><h1>' + count++ + '</h1></html>';
    }
    
    function sendPage(res) {
      var content = getContent();
      res.writeHead(200, {'Content-Type': 'text/html', 'Content-Length':content.length});
      res.end(content);
    }
    
    function onPageRequest(req, res) {
      var a = url.parse(req.url, true);
      if (a.pathname=="/") {
          sendPage(res);
      }
    }
    
    function onConnected() {
      wifi.getIP(function(e,ip) {
        lip = ip.ip;
        require("http").createServer(onPageReque­st).listen(80);
      });
    }
    
    function onInit() {
      wifi = require("Wifi");
      setTimeout(onConnected, 2000);
    }
    

    I used a timeout because wifi.connect("***", { password : "***" }, onConnected) doesn't seem to call 'onConnected'. Anyhow, it runs okay for a minute or so then dies. The console shows this error:

    >E (5287) event: post event to user fail!
    E (8131) event: post event to user fail!
    WARNING: Wifi:startMDNS - espressif
    >E (34066) event: post event to user fail!
    E (36911) event: post event to user fail!
    

    The first 3 lines print on bootup - the last 2 lines print right when the ESP32 dies.

    Searching on the error led me to this page:
    https://github.com/espruino/Espruino/iss­ues/1571
    Which led me to try an older build - specifically this one:
    http://www.espruino.com/binaries/travis/­1a1fd36b740547ece5dda46220c9489bdbd17ff0­/espruino_esp32.bin

    Which looks like 2v00.42. The ESP32 works fine with this build.
    Is there a wifi issue with 2v08?

    Allen

  • in Interfacing
    Avatar for Allen

    Glad you liked my transmitter. Here's the 'receiver'. I originally built them with Arduino, but I am so much happier with Espruino!

  • in Interfacing
    Avatar for Allen

    Oh, it has the new Pico plugged in right now.

  • in Interfacing
    Avatar for Allen

    It is 1.3. I'll try shorting the diode - I can add a diode to the battery.

  • in Interfacing
    Avatar for Allen

    It's empty. I'm going to put my scope back on it and see if 3.3v holds steady throughout the transmission. Wondering if I damaged the regulator.

  • in Interfacing
    Avatar for Allen

    I bought a new Pico and everything works. I haven't figured out what's wrong with my old Pico yet, but 2v03 and the NRF24L01 driver are both fine.

  • in Interfacing
    Avatar for Allen

    I hooked up a storage scope: the timing of CE and CSN signals and even the antenna output of the NRF chip look the same when comparing the Pico and Original boards as transmitters. The radio is definitely transmitting something from the Pico board.

    I'm starting to suspect the Original board as a receiver.

  • in Interfacing
    Avatar for Allen

    @Gordon, I wondered the same thing. I don't remember the previous version - I got the Pico over 2 years ago and never updated it, but it seems like it was 1v7x.
    I will experiment with the send method timing in the NRF module.

  • in Interfacing
    Avatar for Allen

    I built a project a couple of years ago with Pico transmitter and Original board receiver using NRF24L01 radios. I upgraded firmware on both to 2v03 a few days ago and the radio link no longer works (I get TX not received XX errors). I have 10uf caps on both NRF modules. I can get the link to work by programming the Original as the transmitter and Pico as the receiver. I've tried swapping the radio modules + replacing them with some extras I have.

    I also tried using different output pins on the Pico to drive the CE and CSN signals, but still get the same results. I'm reasonably confident the SPI interface is working fine on both boards since I can read various registers on the NRF modules including the RX/TX addresses. I've tried different data rates and power levels. I'm running both boards connected to USB and the IDE. So far nothing has worked - I cannot get it to work with Pico as transmitter and Original as receiver. It always works the other way around.

    I've posted some test code below. I would really appreciate any suggestions!

    Pico Transmitter:

    SPI1.setup({sck:B3, miso:B4, mosi:B5});
    var nrf = require("NRF24L01P").connect( SPI1, B14, B13 );
    function onInit() {
      nrf.init([0,0,0,0,1], [0,0,0,0,2]);
      nrf.setDataRate(250000);
      nrf.setTXPower(1);
    }
    onInit();
    var on = false;
    var i = 0;
    setInterval(function() {
      nrf.sendString("Allen"+i);
      var s = nrf.getStatus();
      print(s.toString(16));
      digitalWrite(LED1, on);
      on = !on;
      if (i++ > 8) i = 0;
    }, 2000);
    

    Original Receiver:

    SPI1.setup({sck:A5, miso:A6, mosi:A7});
    var nrf = require("NRF24L01P").connect( SPI1, B0, B1 );
    function onInit() {
      nrf.init([0,0,0,0,2], [0,0,0,0,1]);
      nrf.setDataRate(250000);
      nrf.setTXPower(1);
    }
    onInit();
    
    dataLine = "";
    setInterval(function() {
      while (nrf.getDataPipe() !== undefined) {
        var data = nrf.getData();
        for (var i in data) {
          var ch = data[i];
          if (ch===0 && dataLine!=="") {
            print(dataLine);
            dataLine = "";
          } else if (ch!==0) {
            dataLine += String.fromCharCode(ch);
          }
        }
      }
    }, 50);
    
Actions