Skip to content
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

Serial output gibberish in INPUT_TO_NETWORK_MODE and dropped fames #13

Open
Duckinahat opened this issue Feb 19, 2018 · 7 comments
Open

Comments

@Duckinahat
Copy link

Duckinahat commented Feb 19, 2018

This is kind of 2 issues, but they might be related. I have 2 identical ESP-12N development boards each with it's own MAX485 driver. I am trying to set up one as a transmitter and the other as a receiver. I am using the ESP-DMX example code. I am not using the configuration utility, but instead changing the values in DMXwifiConfig::initConfig. I can get the boards to talk to each other, however I cannot check any debug information on the transmitter.

The only differences between the 2 in code is the following lines.
Receiver:
_wifi_config->wifi_mode = STATION_MODE;
_wifi_config->protocol_flags = MULTICAST_MODE | STATIC_MODE;
Transmitter:
_wifi_config->wifi_mode = AP_MODE;
_wifi_config->protocol_flags = MULTICAST_MODE | INPUT_TO_NETWORK_MODE | SACN_MODE;

I have uploaded the same code onto both boards to check if it was a hardware issue, but it makes no difference. If the board has the flag INPUT_TO_NETWORK_MODE the serial monitor no longer works, just outputs garbage. I also ruled out AP_MODE, the following outputs correctly:
_wifi_config->wifi_mode = AP_MODE;
_wifi_config->protocol_flags = MULTICAST_MODE | STATIC_MODE;
But this does not work for transmitting over the network.

Despite the serial monitor not working, the code appears to be functioning correctly (or at least partially). The transmitter does set up an access point with the correct parameters, and the receiver connects to it instantly. It seems to be dropping frames though.

I am using qlcplus and a DIY OpenDMX USB device that is transmitting at 30 frames/sec. The ESP transmitter LED is blinking steadily when data is present. The receiver LED is completely sporadic, and the DMX data coming out of it is as well. Both units are running at 160 MHZ, and are located ~10cm apart. They are running off the same 2 amp 5v power supply. I have tested using both SACN_MODE and ARTNET_MODE and neither seem to work better. I have not tried unicast yet, and would prefer to stick with multi if possible.

Has a similar setup worked successfully for anyone else? Wondering if there's something that i am overlooking?

EDIT:
Suspecting the dropped frames were an issue with the AP_MODE, I set up a consumer router as an access point and ran both the transmitter and receiver in STATION_MODE. The transmission became much more stable, and is actually usable now. I suspect that there is some overhead in the softAP that is unable to handle DMX.

I still cannot use the serial monitor, but the system is functioning.

@claudeheintz
Copy link
Owner

I ran a test with 2 ESP32s one configured as Input_To_Network as an access point, the other as a receiver set to log into the first one in station mode. The access point took DMX input and broadcast it as Art-Net. I had to change the _wifi_config->input_address to 10.110.115.255 from 10.255.255.255. I'm guessing this is to match the subnet mask although I believe that the wider broadcast address should have worked as well. At first, I got some strange partial packets. But, then, partly to test the serial monitor, I added a printout of the number of slots and the level of a couple of addresses to the checkInput function in the main sketch. The network output settled down and worked correctly. I haven't had time to investigate. However, in loading both the receiver and transmitter, serial monitor functioned as expected. For this particular test, I was using a Microsoft Surface 4 with Windows 10 Pro. Initially, the serial monitor was set to 9600 baud and the sketch uses 115200 and that, of course, caused an issue with jibberish. But, once the baud settings matched, there was no other sign of a problem with the diagnostic serial. You don't say what computer you are using (and there shouldn't be a problem with 115200) but you can always slow down the baud in the sketch to 9600 and see if that makes a difference.

When I get a chance, I will re-visit the test using sACN. I recall an issue with multicast in access point mode. But, I don't remember specifics or for sure if it was ESP32 and not ESP8266.

@Andreadj
Copy link

Andreadj commented Jun 3, 2019

I have the same problem. Setting UP the trasmitter in AP mode with sACN , Multicast, and input to network it receive DMX signal and blink (and work, I tried it with pin output and led) but it is unable to talk with the receiver set in Station mode with the same ssid. Maybe there's an IP setting problem?
I'm on two Wemos Mini.

Solved: without changing anything after setting receiver in Static mode it starts working even setting back to DHCP. Tried DMX2WIFI without success... Still gibberish on Serial Monitor...

@claudeheintz
Copy link
Owner

SoftAP does not support multicast. You can unicast sACN between two ESP boards, one of which is in access point mode. But multicast does not work unless 1) both boards are in station mode and connected to a WiFi router. 2) the WiFi router allows multicast. The AT&TBGW210 router for my home WiFi network has problems with multicast. Essentially, it does not work reliably even when properly configured. However, I have several cheap Linksys routers (home grade) that do multicast sACN just fine.

The serial monitor is a separate issue. You cannot use Serial Monitor and DMX at the same time with ESP8266 based boards.

@Andreadj
Copy link

Andreadj commented Jun 14, 2019

Hi Claude,
I checked one more time and I confirm it was working with 2 Wemos Mini with 1 in AP mode and the other in Sation mode in Multicast sACN mode and with both in Station mode. After that I try Artnet and loaded sketches with Artnet mode and It did not work anymore in any configuration I used to. Now I'm not understanding why it is working sometimes yes and sometimes not. The Wemos receiver with RGBW Led and passthrough DMX to serial work like a charm with Smatphone and Tablet DMX apk and from PC too (Aurora DMX, sACN View, Q Light controller) both with artnet and sACN. The Wemos trasmitter receives DMX from cable (it blinks) but there's no way I can get it communicate with other wemos neither with Artnet nor sACN, AP mode and Station mode or Station mode for both. Can you write an "How to" to better understand how you do it? There are IP address problems? (you write about DNS or IP address problems?) It can be related to recent Arduino IDE updates ?

Edit: Tryed different approach. Used Wemos with DMX2WIFI and be able to use sACN Multicast in AP Mode and Station mode, Artnet in AP mode but not in Station mode. Used with other Wemos with WIFI2UNIVERSES in Station mode.

@tapi35
Copy link

tapi35 commented Oct 8, 2020

Hello, Andreaj,

I'm sorry because this post is old but it interest me. Do you have resolve your problem ? I want to make the same but for the moment, it doesn't work. So if you could make me win a good dozen of hours, it would be great !!!
How do you configure your receiver and transmitter ? Do you use a router for multicast ?
Thanks

@Andreadj
Copy link

Andreadj commented Oct 8, 2020 via email

@tapi35
Copy link

tapi35 commented Oct 9, 2020

thank you, I will test soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants