New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serial1.on('data', function(data) { ... }) never called #1203
Comments
I guess this is on ESP8266? Did you do what I'd suggested in the last bug that you filed about this? Use |
When i use LoopbackA.setConsole() var LED = whatever_a_led_is_connected_to;
|
Yes. That's because - as I explained on the previous bug you filed, the console is now moved away, so the IDE cannot send or receive data to it: #1199 However you can ignore that message, and everything should work. |
but i tried to get data from the handler and it's not work: dataFromHandler = data;//inside the handler and i tried to display the content of the variable over http server, it always show "", never change. If i change the variable in my code , it's displayed correctly, so the problem is not my http server but there is no data got from the handler. |
How are you wiring everything up? Because remember the RX pin is already connected to the USB adaptor - so if you stick something else on that pin then the signals will be 'fighting'. |
My wiring is little bit complicated: SPI connection: to send command from ESP8266 to Arduino Uno UART connection: to receive response from Arduino Uno both devices are powered by USB cables connected to my PC. Thanks |
But your ESP8266 has a USB connection as well? Which is also (perhaps internally) connected to the RX pin? |
What if you disconnect the Arduino uno from TX, and then upload the same code you had before, randomly type in the IDE, and then check from the HTTP server? You'll probably see data |
if i add LoopbackA.setConsole(); my device is down |
It should still be working - it's just that you can't communicate with it! Just upload this code:
The Web IDE will complain, but try pressing some keys. 'Char' should be displayed every time you press a key. |
This code works, may be i have conflict with SPI ? or http server ? because if i add LoopbackA.setConsole(); my device is down ( no wifi detected on ESP8266 ) else i remove this line , all works fine but can't get data from handler:
|
Maybe someone else can help with this? @MaBecker ? I have no idea why wifi would stop working if you do Just one point though: If you're using SPI correctly you should be able to have two way communications and should have no need to use the UART as well. It might solve a lot of problems for you... |
I tried to use just SPI, but i have a big deal because Espruino don't supporte Slave mode, so i can't send data from Arduino. This is the result what i expected ( work fine without setConsole but no way to get data only display it) command function was :
`Flash map 4MB:512/512, manuf 0xe0 chip 0x4016 =undefined
setConsole crash my http server on wifi. |
Hi @Sparow199, not sure what your trying to build.
Now your Serials are free :)
I guess you would reach much more people if you post such things to the Espruino Forum. |
For AccesPoint it is 192.168.4.1 and Station IP is set via dhcp. |
@MaBecker @gfwilliams thank you very much, i got what i need, using WiFi instead USB resolve Serial1.on handler probleme, i'm able to get data from it now. Adding LoopbackA.setConsole(); crash the device, i don't know why ? |
not on my side - feel free to close this issue :) |
# This code is not working for me. I tried below code...and tried many ways but not receiving on RX but TX works fine.
|
Sorry - github is not the place for these kind of questions. issues here's are for the C code that runs. Espruino. Post your question here in the esp8266 section of the forum. http://forum.espruino.com/microcosms/925/ Thanks |
ok but if you or any other can solve, It should great |
Hello,
I send command over SPI and get the response via Serial.
I work fine with console, but i can't get response data to be processed.
I tried to setup ( with disconnected usb, i tried to get the value of data with http server ) Serial.on ... but it's never called, i used examples and i respected instructions in official documentation.
The text was updated successfully, but these errors were encountered: