Serial UART connect Teensy - NodeMCU

Status
Not open for further replies.

Menne

Member
Hi,

I'm trying to build a connect between the Teensy and a Nodemcu for a webhook towards a server. the connection is meant for sending only data (char or byte) when a Teensy audio mode is changed (0, 1, 2 or 3). Mode changes only take place approx 10-20 times a day, so there is a very limited data send.

I'm using Teensy HWserial pin 0 (RX) and pin 1 (TX) and on the NodeMCU I use GPIO5 (TX) and GPIO4 (RX).

The problem is that I do not get any data on the NodeMCU. I did test the Teensy (cross connected RX with TX and tested succesfully transmission between TX and RX). I checked multiple times that RX is connected with TX. Changed from char to bytes. Changed baudrates.

Does someone help me to understand this problem?

I attached the Teensy ino file and NodeMCU ino file and a overview picture.

View attachment Lolin_WebhookHomeyv4.inoView attachment SD_readwrite.ino IMG_4810.jpg
 
As far as I can tell your SD_readwrite.ino does not output anything to Serial1...

Everyplace Serial1 and HWSERIAL are referenced are commented out:
//#define HWSERIAL Serial1
// HWSERIAL.begin(9600);
//HWSERIAL.write(0);
...
 
I was doing nearly the same exact thing. My Teensy 3.2 was processing sensor data, talking to displays and getting data wirelessly, then sending data to and ESP8266 for web serving (as an access point). I was passing a struct from the teensy to the ESP ( 58 bytes every second), and could not get data to read reliably on the ESP. I turned out different MCU's pack data differently hence causing data corruption--I've yet to understand why, but my only fix was to use a special library that sends data so other MCU's can read it.

For the ESP8266
#include <SoftEasyTransfer.h> // needed to transfer structs between different MCU's

For the teensy
#include <EasyTransfer.h> // needed to handle serial transmission between different MCU

The lib had enough examples for me to implement a workable solution. A different lib needs to be on the teensy as it uses a hardware serial.

Not sure the will help, but passing along my experience, maybe it will help you..
 
As far as I can tell your SD_readwrite.ino does not output anything to Serial1...

Everyplace Serial1 and HWSERIAL are referenced are commented out:
//#define HWSERIAL Serial1
// HWSERIAL.begin(9600);
//HWSERIAL.write(0);
...

Sorry Kurt,

I send the wrong version, please check the latest one. not much difference but I removed the "comment" operator.
View attachment SD_readwrite.ino

thanks
 
Hi Kris,

thanks and as you suceeded it must be a good direction. I found many "working" cases (UNO - MCU) but never from a Teensy to an MCU, so I hope someone from the community can still shine some light on this.

As I send only data from the Teensy to the NodeMCU, i will check the EasyTransfer.lib.
 
Tx Frank,

indeed that was the issue and I corrected it to Serial1.
After some iterations, I was able to interpreting the data send from byte to char and send a webhook with the data.

Appreciated all the feedback received.
 
Status
Not open for further replies.
Back
Top