Hello, I’m currently attempting to build a flight controller using an ESP8266 NodeMCU board. Everything is working except for connecting my receiver (an FS-i6b) to said board.
I’m using the ibus protocol, however since the ESP8266 only has the one full UART, I can’t have the receiver hooked up to the RX as normal or else it interferes with flashing and serial debugging (I currently have pin D4 bridged to TX for Serial1 output).
Serial.swap() seems like it would solve my issue however I still cannot read any signal.
My wiring is currently:
Receiver Data pin -> D7
D4 -> TX
Is there something I’m missing that’s causing my problems? Or is there a much easier way to pull off using iBus RX on the ESP8266? Any help would be super appreciated!
D4 is connected to TX, sorry typo. As for the risks of bridging, I’m only using it for debugging, and if Serial.swap() does what it’s supposed to, TX should never be outputting directly. Channel 0 should be transmitting at minimum a 1000ms signal. It works when I hook it up to my arduino so I’m fairly confident it’s transmitting correctly.
It works when I use a device with two full uart serials.
I also experimented with removing the library I was using and rolling my own rudimentary ibus protocol reader, which actually worked. So it seems there’s something in the library I was using wasn’t playing nice…
well looking at the src (the .cpp & .h) it seems that esp8266 is not really supported, doesn't this show up when you compile ?
#warning "Timing only supportted for AVR, ESP32 and STM32 architectures. Use timerid IBUSBM_NOTIMER"
and timers on an esp8266 are a bit troublesome to say the least. The timers that exist are in use by wifi connection as far as i know.
so (from IBusBM.cpp)
// we need to process the iBUS sensor protocol handler frequently enough (at least once each ms) to ensure the response data
// from the sensor is sent on time to the receiver
// if timerid==IBUSBM_NOTIMER the user is responsible for calling the loop function
which means that you should call begin like this
ibus.begin(Serial, IBUSBM_NOTIMER);
and call
ibus.loop();
within loop regularly, which means you should probably get rid of the delay() and change serial1.println() into a millis() elapsed time method.