Are you running Espruino on the module itself, or do you have Espruino running elsewhere and you're trying to send data to it?

If you've flashed Espruino onto the module itself then yeah, what you're doing sounds ok - you could try sending just the String "A00101A2" just in case that was it?

However, the problem is that when the ESP8266 module is working as it does normally as seems to be described in that link above, it won't just output that hex code - there's some other stuff too. Something along the lines of +IPD0,4:\xA0\x01\x01\xA2

To be sure, you'd probably have to flash the normal AT command firmware, get it working, then connect your PC and figure out exactly what got sent.

I'm running the code on the ESP8266 that is on the device, so in theory I should just power the device, and it should load the code, and start switching the relay. I just wanted to do a simple test before doing anything else to ensure I could control it.

I did connect an FTDI to is while it was running and it did seem to be sending more that just those commands to the out. basically anything outputted to the console was getting sent too. Is there a way to redirect the console outputs to another channel that I can observe, whilst keeping the serial1 channel just for the comms to the module?

I did also try just sending the commands directly from my pc using some node js code, but I still couldn't get it to work at all.

I have a second relay module so might try that incase there is a fault with that one, but it just seemed very unresponsive.

Next thing will be to get it working as per the original spec as you suggest to make sure the board actually works!

Is there a way to redirect the console outputs to another channel that I can observe, whilst keeping the serial1 channel just for the comms to the module?

Yes, just use LoopbackA.setConsole() and then add whatever listener you want with LoopbackB.on('data', ...) - or just replace LoopbackA with whatever output device you want the JS console to appear on.

Post a reply

Bold

Italics

Link

Image

List

Quote

code

Preview

Formatting Help

Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.

Tips:

Create headers by underlining text with ==== or ----

To *italicise* text put one asterisk each side of the word

To **bold** text put two asterisks each side of the word

Embed images by entering: ![](https://www.google.co.uk/images/srpr/logo4w.png)That's the hard one: exclamation, square brackets and then the URL to the image in brackets.

* Create lists by starting lines with asterisks

1. Create numbered lists by starting lines with a number and a dot

> Quote text by starting lines with >

Mention another user by @username

For syntax highlighting, surround the code block with three backticks:

```
Your code goes here
```
Just like Github, a blank line must precede a code block.

If you upload more than 5 files we will display all attachments as thumbnails.