PICO + HUZZAH 8266 + WebIDE

Posted on
  • Hello, I have a PICO connected to an Adafruit HUZZAH 8266 via Serial1. The 8266 is running esp-link, and I can connect to the PICO fine with either telnet or nc (as well as to the esp-link web server), but it would be much nicer if I could connect using the WebIDE. I have tried putting the address of the board (ie 192.168.10.20:23) in the communications section, but it always fails to connect. I have only set the baud rate in an init file because I believe the console is already switched to Serial1 when there is no USB connection (at least it certainly acts like the console when I connect via nc). Is there something else I need to do to get the WebIDE to connect?

    I think the Adafruit 8266 is a useful addition to support as it is an esp-12 already on a breakout board with power supply, and still only costs $10.

    Thanks for the help!

  • I hadn't heard about esp-link - that's really cool!

    So you can connect to the pico over the net fine with a terminal application, you just need to do it with the Web IDE? Using that option in the communications section should work fine. Maybe you could test it by running: nc -l 1234 to listen for a connection, and then try and connect to YOUR_IP:1234 in the Web IDE and see if that works?

    I did try this here and it seems to work - it wasn't just something like a typo in the IP address?

  • [edited] if you have problems with hooking up the WebIDE over TCP/IP, you could introduce a serial to TCP/IP proxy? There are some suggestions for doing this in the second section of http://blog.philippklaus.de/2011/08/make­-rs232-serial-devices-accessible-via-eth­ernet/
    Nice idea to remote program the Pico

  • I hadn't heard about esp-link - that's really cool!

    Thanks :-)

  • My problem getting WebIDE to work with esp-link was ip address related (DHCP changing the addr). I now have a static addr for the esp-link node, and the WebIDE works. So far, it seems that while the console works at 115200, there are problems uploading scripts at that speed. I backed it down to 9600, and that problem seems to go away. I will try finding a higher baud rate at which it will work, and post results later. I need to play with it a bit on battery power etc to make sure all is working well, but initial results seem fine.

    An oddity with the WebIDE is that once a connection has failed, it seems necessary to quit the WebIDE and restart it to get a working connection. I am not sure if this has to do with the network connection or the WebIDE. More testing may help understand what is going on.

  • Great! Glad it's working! Chances are upload issues are due to lack of flow control. Some things (like Modules) take a while to add, and it's possible that so many characters get received that the buffer fills up and stuff gets dropped.

    You can turn on XON/XOFF software flow control, but I don't know if esp-link supports it... @tve?

    it seems necessary to quit the WebIDE and restart it to get a working connection

    It could well be a bug in the IDE's code. The Telnet stuff hasn't been tested very well.

    If you get the Web IDE from GitHub and use that, you'll be able to right-click, inspect element, and then see the JavaScript console which might give you some hints?

    @tve when I was looking at it I saw your GitHub username all over it :) Do you run Jeelabs then?

  • Jeelabs is Jean-Claude Wippler's thing, I'm just a remote participant. It's not a commercial entity. I wrote the vast majority of esp-link.
    WRT flow control, esp-link is a plain pass-through. So you'd get xon/xoff end-to-end, which may or may not work.

  • How large is the UART buffer on the pico? I'd hate to add xon/xoff to esp-link, but maybe that's the best solution. Would be nicest if the IDE could pause after a logical unit, like a module, and then wait for some form of ack from the board.

  • The buffer is 256 bytes-ish IIRC. Unfortunately Chrome doesn't let you use XON/XOFF, so actually it's not that helpful. I kept meaning to implement it in software but never got around to it :)

    Some kind of ack after each command would be great - it'd help with upload issues on some other boards too. I was trying to think if a nice way to do it though - any ideas?

    I mis-used a control code so you could start a line with \x10 and echo would be turned off for just that line. I could extend that so that when the line executed another control code was sent back to the IDE.

  • if you turn echo off on \x10 when do you turn it back on? If it's after the newline you could turn it on before the newline instead, then you have your ack? Mhh, I guess you need to hold the ack until you processed the line. So use the same idea but don't echo the newline, print it after processing the line...

  • Yep, it turns off after a newline.

    Well, I kind of wanted a non-displayable char that could easily be filtered out by the terminal (eg. not explicitly having to know that I'd sent the echo off code).

    What about ACK (0x06)? I could also detect execution errors and do NACK (0x15) as well? That way I could possibly even report back problems on the right-hand side of the IDE.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

PICO + HUZZAH 8266 + WebIDE

Posted by Avatar for dgustavus @dgustavus

Actions