Espruino original <> ESP32 serial communication #983
Replies: 11 comments
-
Posted at 2018-06-04 by @gfwilliams I'm not sure. I'd maybe try different pins on ESP32, also maybe disconnect the two boards, short RX and TX on each board, and see if you can receive what you sent on the same board - it's a good way of problem-finding. It looks like you might be able to run an AT command firmware on ESP32, in which case this code might get you proper WiFi on the original Espruino. Of course if you had an ESP8266 lying around that'd probably be preferable in this case! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-04 by n00b Thanks Gordon - Sorry it was me being a N00b: GND need to connect between the 2 boards. Kept forgetting about that one :/ |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-07 by DrAzzy I thought UART2 on ESP32 was on 16 and 17? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-07 by n00b @drazzy this is the board I’m using: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-08 by DrAzzy Hmm. Per this page: http://www.espruino.com/ESP32 UART2 is on 16 and 17... (and it works beautifully on these pins) So something isn't making sense here... Another thing that's strange here is that - at least at 115200 baud - on ESP32 side, the on('data') callback is called only once, with the whole blob of data, rather than once per char... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-09 by JumJum For information only, there is an overlapping of GPIO16/17 on some boards |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-09 by n00b I switched board to another one (NODEMCU ESP32), switched to GPIO16/17, and did a simple test ESP32:
on Espruino
Strange. Can confirm that message sent from Espruino is received on ESP32 as entire blob instead of per character... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-09 by n00b I switched the pins and did ESP32
Got on Espruino:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-11 by @gfwilliams How many characters you receive at a time depends on lots of things, so I wouldn't worry about it - for instance if Espruino is busy running some code then you'll get lots of characters at once. It might be related to the fact that ESP32 will have to send out the data it received out of a UART that is the same speed as the UART it receives data on. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-11 by n00b @gordon for my purpose I have to get the entire message before deciding next step of actions. Does this mean it’s best practice to always buffer the data for the busy case you mentioned above even for Espruino boards? I’ve been wrapping the message from ESP32 board with a start and end chars (<,>)so Espruino can understand whole messages, is there a proper way to detect start and end of transmission? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-11 by @gfwilliams Yes, I'd always buffer it. I think it's pretty common practice to just use the newline character:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-06-04 by n00b
Hi,
I need to use WIFI and have an original espruino and an esp32 lying board around. Eventually will just get an espruino WIFI, but seems like fun to tinker using the esp32 as the wifi 'board' so I did :)
So the strategy I have in mind is connecting the two via serial have them communicate that way. Tried the simple loopback test and seemed to work fine. With the actual connection I'm getting garbage character most of the time.
on ESP32:
On Espruino:
Result:
Is there anything different I need to do? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions