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

Telemetry not working with 3 sensor #33

Open
magnum3131 opened this issue Jun 20, 2021 · 50 comments
Open

Telemetry not working with 3 sensor #33

magnum3131 opened this issue Jun 20, 2021 · 50 comments
Labels
bug Something isn't working inProgress already working on that
Milestone

Comments

@magnum3131
Copy link

Hi,

I use your library to make some sensor ( Temperature, GPS,...). if i plug only 2 sensors on the receiver with different slot everything is working perfectly.

But if i plug 3 sensors the telemetry on esp32 stop working, i have to stop one oh the three sensor to make it working again

Is there a limitation or something wich can explain these issue ?

Thanks
Julien

@BrushlessPower
Copy link
Owner

Hi Julien,

interesting issue. Never thought about using multiple ESP32 (or Atmega) Sensors.

i have an idea whats causing the issue:
the Sensors (the third) could trigger the Start/End of a SBUS(2) Frame in the other Sensors. That would cause many problems.

If i'am right the same should happen with a original Futaba Sensor.
i have to check the code and try to get the same behavior.

Could yo tell me with Sensors you use on which slot and which ESP?
Example:
ESP32 No.1 -> temp sensor Slot2, Voltage Sensor Slot3
ESP32 No.2 -> GPS Slot 8
ESP32 No3. -> .....

Do the ESP32 anything? Are they crashing? Error Messages?

@magnum3131
Copy link
Author

Hi,
Thanks a lot for your answer
ESP32 1 => Slot 1 rpm sensor
ESP32 2 => Slot 3 rpm sensor
ESP32 3 => Slot 5 rpm sensor

I made a loop wich increase the RPM, i can see when the telemetry stop working. When i plug the third sensor the telemetry stop working immediatly. there is no message or crach on ESP32.

I'll test this evening ig i have the same problem if i plug a futaba sensor

Thanks
Julien

@magnum3131
Copy link
Author

I did more test
The configuration is the following
Powerbox Spark Switch pro => slot 1 to 5
Powerbox Mercury => slot 8 to 23
ESP32-1 RPM => slot 6
ESP32-2 RPM => slot 7

Case 1
Powerbox Spark Switch pro + Mercury + ESP32-1 => Working

Case 2
Powerbox Spark Switch pro + Mercury + ESP32-2 => Working

Case 3
Powerbox Spark Switch pro + Mercury + ESP32-2 + ESP32-2 => Powerbox Sensor working but not the ESP32.

With other telemetry sensor i can only plug one ESP32

Thanks
Julien

@BrushlessPower BrushlessPower added the bug Something isn't working label Jun 22, 2021
@BrushlessPower
Copy link
Owner

Dear Julien,

thank you for testing. I have 3 ESP32 and i will build up the same test an try to find the problem.

I think it could be a Problem with the 1k resistor between RX and TX of every ESP32 on the SBUS. But i can only check it with an oscilloscope.

Cold you try another test (before i finish my test build)?
ESP32-1 with 2,3,4,5 RPM Sensors on SLOT 1 to 6
ESP32-2 with just one RPM Sensor on SLOT 7

You said "the Telemetry stop working". So my understanding is, that all three RPM Sensors stop working? This would really point to a problem with the 1k resistor.

@magnum3131
Copy link
Author

Hi,
I'll test the new case this evening
I don't know if it could affect the SBUS2 Library but i have a 2.4 resistor between the TX/RX Pin

Thanks
Julien

@BrushlessPower
Copy link
Owner

hi,
2k4 Resistor is ok.
I had problems with a R7003SB. This one only worked with 1k. Thats why i recommend 1k.

Maybe its better to use a diode.

@magnum3131
Copy link
Author

This is strange, the test with powerbox and esp32 has been done with a 7003sb on my plane

I'll try with a 7008
Julien

@magnum3131
Copy link
Author

Hi,
I do your test
ESP32-1 with 2,3,4,5 RPM Sensors on SLOT 1 to 6
ESP32-2 with just one RPM Sensor on SLOT 7

It's working with the 7008sb but not with the 7003sb, only one sensor work with the 7003

You said "the Telemetry stop working". So my understanding is, that all three RPM Sensors stop working? This would really point to a problem with the 1k resistor. => Yes all three RPM stop working

Do you think we need to lower the value of the resistor ?

Thanks
Julien

@BrushlessPower
Copy link
Owner

Ok

i really think it's the value of the Resistor. You could try to increase it when using multiple ESP32
Today i will have a look on the scope.

The perfect solution would be a one wire Serial with switching RX/TX on one Pin.

@BrushlessPower
Copy link
Owner

So i got a View on the Scope and got back to the old Problem with 1k on R7003

  1. The Resistor Value has to be small enough that the TX Pin can Pull High Signal on the SBUS (when transmitting Telemetry)
  2. The Resistor Value should be as big as possible that the Servo Data is not pulled down to much (when receiving SBUS Frame and other telemetry)

for the R7008 4k7 and 1k was ok on my test
for the R7003 1k was ok on my test

But, when we connect multiple ESP32 on the same SBUS the Resistor Values are not valid any more

with three ESP32 (each with 1k) the Pull Down Resitance is 1k/3 = 333R -> thats much to low
and the pull up resistance i still 1k for each ESP32 to transmit his slot. But it has to work against the other 2 ESP32 with 500R

so at the End: The resistor Solution is not the Best
Did you have some diodes there?
You should add a diode between TX and the 1k. Anode to TX, Cathode to Resistor.

TX------>|----1k-----SBUS

RX-------------------SBUS

The Diode should have a low Forward Voltage Drop. I have tested it with a BAV21 and a high Drop (1V Voltage Drop) and it's working.
SBUS

@magnum3131
Copy link
Author

Hi,

Thanks a lot for your expertise, for resuming i have to change my 2.4k resistor for a 1k and i have to add a diode. I need to place an order to test all this.

For the diode i found the 1N4148 which have a drop down of 0.7 or maybe a schottky diode with a lower drop down, I need to check a reference for a schottky.

Thanks a lot, I'll let you know when i'll have everything for testing

Other question what kind of oscilloscope do you use ?

Thanks
Julien

@BrushlessPower
Copy link
Owner

The 1N4148 should be fine

Maybe you can also order a Schottkey with a high reverse Voltage (more than 10V). But this is something about try an error.

I use a PicoScope 2405A.
But the cheap PicoScope 2204A is also fine. But 2 Channel are not enough for my tasks.

Did you notice Issue #34 ?

@magnum3131
Copy link
Author

Hi,

I order all the stuff, i hope i'll receive next week. I had to find a solution because in my club we try to do ESP32 hardware which can work with Futaba (1k on TX) and Jeti (Jeti need a 2.4k resistor on the RX pin)

For the arduino core I am in 1.0.4, the 1.0.6 is available i hope the bug is not present in this version

Thanks a lot
Julien

@BrushlessPower
Copy link
Owner

The solution with diode should also work with with 2k4.

i have the feeling that the 1.0.6 is more stable. I had a lot of issues with 1.0.5 and the are fixed with 1.0.6

p.s.
withe Jeti Telemetry you mean EXBUS?
Not EX?
until now, i cant find a good solution for ESP32 with EX Telemetry because the ESP32 cant handle 9 Data Bits

@magnum3131
Copy link
Author

Yes ex bus
I use this library
https://github.com/Sepp62/JetiExBus
Julien

@BrushlessPower
Copy link
Owner

any news here?

@magnum3131
Copy link
Author

magnum3131 commented Jul 22, 2021 via email

@ericlangel
Copy link
Collaborator

ericlangel commented Jul 23, 2021

@magnum3131

could you try the new Version of the library?
Some issues are solved (nothing real important)
and a new Feature is coded: reading Sensor Values of all SBUS Sensors on the Bus

and you have some ESP32 on the SBUS and a Powerbox Spark Switch pro and Powerbox Mercury

@magnum3131
Copy link
Author

magnum3131 commented Jul 28, 2021 via email

@ericlangel
Copy link
Collaborator

i have attached the new library and an Example sketch.

please change the SBUS2 Pins to your used SBUS2 Pins.
leave Pin 16 and 17 unconnected -> that is another topic

Now use my SBUS2 Library as usual.
You will get some prints for Sensor Slot 0 to 7. You can extend it to Slot31
The Output on console should show the value used for the emulated RPM Sensor
And Slot0 (RX Voltage) and your other Sensors with their Slot Number

If that is working, we can go to the next Topic.

SBUS2.zip

@ericlangel
Copy link
Collaborator

@magnum3131

i have a new Library Version which should work with 1k resistor and multiple Sensors (without diode or Voltage loss)
the TX Pin is just active (OUTPUT) when sending Telemetry Data. After that its disabled (INPUT/Floating).

It's not fully tested, but the first Test looks good

Please tell me if you want to test?

@magnum3131
Copy link
Author

magnum3131 commented Aug 3, 2021 via email

@ericlangel
Copy link
Collaborator

ericlangel commented Aug 3, 2021

[edit] File removed

here the update
for explanation: the example sketch also sends sbus2 Frames on Serial2 -> so leave Pin 16 and 17 unconnected or use your sketch and just update the sources

@magnum3131
Copy link
Author

magnum3131 commented Aug 3, 2021 via email

@ericlangel
Copy link
Collaborator

ok, you could erase all Serial2 code in the example sketch

or use your old sketch and just update the library sources

@ericlangel
Copy link
Collaborator

tonight i realized that the zip file i gave you wont work.

because Change TX to Float and back to TX is hardcoded to GPIO 26
i will change it and upload again

@ericlangel ericlangel added the inProgress already working on that label Aug 5, 2021
@magnum3131
Copy link
Author

magnum3131 commented Aug 7, 2021 via email

@magnum3131
Copy link
Author

magnum3131 commented Aug 8, 2021 via email

@BrushlessPower
Copy link
Owner

hi julien,

i forgot to upload the new version.
There are so many changes the last weeks.

I have no plan which version u are using

i upload as soon as possible

@magnum3131
Copy link
Author

magnum3131 commented Aug 11, 2021 via email

@ericlangel
Copy link
Collaborator

ericlangel commented Aug 17, 2021

Here the actual Version
It's like a pre release, but i have not tested with multiple Sensors.
There are now some more Examples for the different use cases.
Atmega328P is not updated

removed file

@magnum3131
Copy link
Author

magnum3131 commented Aug 17, 2021 via email

@ericlangel
Copy link
Collaborator

SBUS2.zip

This one works just with 1k between RX and TX and both RX's connected
ESP32 No1 = Simulation Mode + Slot 7
ESP32 No2 = Normal Mode with Slot 1 to 19 (without Slot7)

All Slots are displayed
All Signal Levels are ok
removed Error Prints

@magnum3131
Copy link
Author

magnum3131 commented Aug 18, 2021 via email

@ericlangel
Copy link
Collaborator

i will test it with a real futaba RX (not ESP32 Simulation Mode)

maybe something else was crashing. i have to make my sbus cable with a plug. so that i can dis/connect the ESP32 to see if there are faults

@ericlangel
Copy link
Collaborator

hi julien,

i had the same issue. When connecting/disconnecting the ESP32 to the SBUS2 Port the USART Interrupt crashed.

i fixed that issue:
SBUS2.zip

For Future Test: Enable the CoreDebugLevel for ESP32 to "Info". Then you will get Error Messages when something goes wrong on the SBUS Stuff.

i had a look on the Scope with ESP32, 1k and R7003
SBUSFrame (and Slot0) are at 3.3V
The RPM Sensors from ESP32-1 and ESP32-2 are at 2.0V

That's OK
But i would recommend 1k when using R7003.
With R7008 the 2k4 could be fine.

What i want to say.....in my DIY ESC with Futaba and Jeti Telemetry i have used 1k. And the Jeti Telemetry is fine with it

@magnum3131
Copy link
Author

magnum3131 commented Aug 18, 2021 via email

@ericlangel
Copy link
Collaborator

Nice that it is working

this error should just occur when connecting/disconnecting an ESP32 to the SBUS.
it really should not occur in normal operation.

could you look how often it is displayed?
everytime the same ESP?
it could be also an issue of not enough signal voltage (maybe better to use 1k?)

@magnum3131
Copy link
Author

magnum3131 commented Aug 19, 2021 via email

@ericlangel
Copy link
Collaborator

Hi Julien,

the Errors seems to be Bytes that are not read correctly. I think that is an issue from the 2k4.
It would be really great if you could test it again with 1k.

I will add some more detailed Error Messages to the Log to make the debugging easier.
I will upload it to the git repo for everyone. It seems that it is stable enough for a release

@magnum3131
Copy link
Author

magnum3131 commented Aug 25, 2021 via email

@BrushlessPower
Copy link
Owner

Hi Julien,
could you post the backtrace error message?

@magnum3131
Copy link
Author

magnum3131 commented Aug 26, 2021 via email

@magnum3131
Copy link
Author

magnum3131 commented Aug 26, 2021 via email

@ericlangel
Copy link
Collaborator

Maybe i have an idea whats happening.
Did it also happen with 2 ESP's?
Or just with 4?
or just when another Sensor is used?

The sketches running on the ESP's are the example sketch just with different Slot's and Sensors?
No Flash(FFAT/SPIFFS/.....) Write/Reads?
No EEPROM Write Read?

@magnum3131
Copy link
Author

magnum3131 commented Aug 26, 2021 via email

@ericlangel
Copy link
Collaborator

ericlangel commented Aug 26, 2021

If you write the EEPROM before SBUS_Setup() it is OK.

if you want to write EEPROM in Runtime, you have to disable SBUS before write and enable after write EEPROM

see #30

i have the same issue on my diy ESC with ESP and sbus lib
here is the working code:

SBUS_disable();
EEPROM.write( ... );
EEPROM.commit();
SBUS_enable();

i will try to test it here with 2 ESP's
the problem with plugging is:

maybe you plug in (or sbus is ready) in the middle of a Frame.
This should causes an invalid frame and should be fine with the next Frame.

But i'am actual not sure what the timer Intterupt do
I think it is started right after sbus_stetup and maybe crashes....i have to test it.

@magnum3131
Copy link
Author

magnum3131 commented Aug 26, 2021 via email

@magnum3131
Copy link
Author

magnum3131 commented Aug 28, 2021 via email

@ericlangel
Copy link
Collaborator

hi magnum,

first: we should move this to direct email. because i would like to see your testsketch and try it here

email: brushlesspower@protonmail.com

second: what do you mean with " i switch on the ESP32 connected to the receiver"?

is the ESP32 powered by receiver 5v?
is the receiver powered by ESP?
different power sources?
SBUS2 Cable already connected?
a lot of things.....

i tried it with connecting/Disconnecting SBUS cable -> no crash
i tried with plug in ESP32 to receiver (3pol servo cable)
i didn' try powering esp32 and receiver from different sources.....

Please write me an email with some more informations what you are doing and with your code. Then i can reproduce it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working inProgress already working on that
Projects
None yet
Development

No branches or pull requests

3 participants