LXESP8266DMX
LXESP8266DMX copied to clipboard
How to Connect ESP, RS485Module and XLR Connector
Hello, Just need if esp must be connected to an rs485 board and how. I plan to use serial0 as receiver and Serial1 for debug (we need just tx to serial print). My goal is to receive dmx signal from a controller and do some action with value received (for ex. dimming a led controlled by my domotic system)...
Please , in this moment i'm trying to use your library with this connections : Serial connected to USBTTL (RX,TX) Pin 02 of esp connected to DI of RS485 module Pin 0 set to LOW (in setup) connected to DE and RE Pin4 connected to a led A of RS485 module to Data1+ Pin 3 of XLR B of RS485 module to Data1- Pin 2 of XLR GND to Pin1 of XLR XLR connected to a normal DMX Controller
What baudrate i must set serial? This is my sketch :
`#include <LXESP8266UARTDMX.h>
int got_dmx = 0;
void setup() { //WiFi.forceSleepBegin(); //not using WiFi, sleep to prevent background activity Serial.begin(115200); pinMode(0, OUTPUT); digitalWrite(0, LOW); ESP8266DMX.setDataReceivedCallback(&gotDMXCallback); delay(1000); //avoid boot print?? ESP8266DMX.startInput(); Serial.println("."); Serial.println("DMX Receiver Start"); }
// ***************** input callback function *************
void gotDMXCallback(int slots) { got_dmx = slots; }
/************************************************************************
The main loop checks to see if dmx input is available (got_dmx>0) And then reads the level of dimmer 1 to set PWM level of LED connected to pin 14
*************************************************************************/
void loop() { if ( got_dmx ) { //ESP8266 PWM is 10bit 0-1024 //analogWrite(14,2*ESP8266DMX.getSlot(1)); Serial.print("DMX ricevuto!!!"); Serial.print(ESP8266DMX.getSlot(1)); } //wdt_reset(); } `
Where is the error ? Thanks a lot
This library is not compatible with Serial.
You need to find another way to signal yourself about what is happening with your sketch. You can usually do this with LEWDs attached to pins which you set HIGH or LOW. For fast changes, you may need to observe what is happening with a logic probe.
The library is not compatible with Serial. Remove all the code that references it. Find another way to signal yourself about what is happening when your sketch runs.
-Claude Heintz
On Mon, 11 Apr 2022 08:55:52 -0700, DarioCdj @.***> wrote:
Please , in this moment i'm trying to use your library with this connections : Serial connected to USBTTL (RX,TX) Pin 02 of esp connected to DI of RS485 module Pin 0 set to LOW (in setup) connected to DE and RE
What baudrate i must set serial? This is my sketch :
`#include <LXESP8266UARTDMX.h>
int got_dmx = 0;
void setup() { //WiFi.forceSleepBegin(); //not using WiFi, sleep to prevent background activity Serial.begin(115200); pinMode(4, OUTPUT); pinMode(0, OUTPUT); digitalWrite(0, LOW); ESP8266DMX.setDataReceivedCallback(&gotDMXCallback); delay(1000); //avoid boot print?? ESP8266DMX.startInput(); Serial.println("."); Serial.println("DMX Receiver Start"); }
// ***************** input callback function *************
void gotDMXCallback(int slots) { got_dmx = slots; }
/************************************************************************
The main loop checks to see if dmx input is available (got_dmx>0) And then reads the level of dimmer 1 to set PWM level of LED connected to pin 14
*************************************************************************/
void loop() { if ( got_dmx ) { //ESP8266 PWM is 10bit 0-1024 analogWrite(14,2*ESP8266DMX.getSlot(1)); Serial.print("DMX ricevuto!!!"); } //wdt_reset(); } `
Where is the error ? Thanks a lot
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Not compatible with serial? I don't understand ... What's the goal of this library? How it works? Where is connection wiring added in the sample? See attach pleaseDario CiriminnaTel.+39-3920559519 -------- Messaggio originale --------Da: Claude Heintz @.> Data: 11/04/22 21:27 (GMT+01:00) A: claudeheintz/LXESP8266DMX @.> Cc: DarioCdj @.>, Author @.> Oggetto: Re: [claudeheintz/LXESP8266DMX] How to Connect ESP, RS485Module and XLR Connector (Issue #9) This library is not compatible with Serial. You need to find another way to signal yourself about what is happening with your sketch. You can usually do this with LEWDs attached to pins which you set HIGH or LOW. For fast changes, you may need to observe what is happening with a logic probe.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
ESP8266 has limited hardware UARTs which are used by Serial. Serial is a class (as in Serial.begin(9600);) which is used to communicate with a computer. Serial is often used to write to Arduino's serial monitor.
This library also uses the UARTs for DMX serial input and output. So, you cannot use both in the same sketch.
The same UARTs are used to upload a sketch. It is common to have to disconnect a RS485 circuit when uploading a sketch using this library.