dgatf / msrc

Multi Sensor for RC with RP2040 - FrSky D, SmartPort, XBUS, SRXL, IBUS, SBUS, Multiplex Sensor Bus, Jeti Ex Bus, Hitec
GNU General Public License v3.0
169 stars 41 forks source link

Spektrum X-bus -- Hobbywing HV V4 issue #19

Closed J-charles-C closed 3 years ago

J-charles-C commented 3 years ago

Hello,

I uploaded the firmware and the arduino is pafaitement recognized in the telemetry in "auto-config".

In config.h I have activated "#define CONFIG_ESC_PROTOCOL PROTOCOL_HW_V4_HV".

however, when I plug the "hobbywing rpm" wire into my Arduino, I have no data going back.

cordially

dgatf commented 3 years ago

Bug fixed

Please try again

J-charles-C commented 3 years ago

Ok i test.

thanks

J-charles-C commented 3 years ago

I,

not better

best

J-charles-C commented 3 years ago

I just reread the readme and there may be some problem with the RX and arduino with USB port.

I have this model and the ESC is only plugged into the RX0 port. Is it well connected?

https://www.amazon.fr/gp/product/B0722YYBSS/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1

dgatf commented 3 years ago

Yes, that's the problem. The serial signal from the esc is not strong enough for a serial port shared with usb on the arduino board

J-charles-C commented 3 years ago

is there a solution ?

dgatf commented 3 years ago

Yes. I've added more flexibility to use software serial with any serial interface. Now you should be able to select softwareserial for the ESC. This can be done as you are using XBUS. With smartport this wouldn't be feasible as software serial is required for smartport to invert the serial signal

Update line 30 from config.h:

#define ESC_SERIAL softSerial and connect ESC serial to pin 7 (_PIN_SOFTSERIALRX)

Not much tested yet... let me know

J-charles-C commented 3 years ago

I,

Thanks ok, i test today with D7.

best

J-charles-C commented 3 years ago

Hello,

sorry, I couldn't test yesterday because i work.

I used the version from yesterday. I welded in D7, modified line 71.

So I no longer have the tirests but I now have a value of 0 everywhere.

If it is worth testing, can you give me the line to modify on today's version? cordially

dgatf commented 3 years ago

Modify line 30 in config.h:

#define ESC_SERIAL softSerial

The reason behind is that ESC serial uses 3.3v logic level whereas your Arduino board is 5v. Thus a 3.3v (8mhz) board is recommended. There are versions of Pro Mini and Pro Micro for 3.3v (8mhz). Also Pro Mini 5v (without USB) usually works well

As a workaround you can try with the software serial (by modifying config.h as explained before) which usually gives better results with this issue

dgatf commented 3 years ago

To verify that the ESC can be read with your board you can use the sniffer.ino sketch (under tools) and connect ESC data to pin 10, ESC GND to GND and see the debug on the serial monitor at 19200 baud

J-charles-C commented 3 years ago

Good evening,

I tested without success. I don't know how to use the debug.

So, is this model the right one?

https://www.amazon.fr/Microcontrôleur-ATmega328P-développement-compatible-Arduino/dp/B01DUSDQQ8/ref=sr_1_2?__mk_fr_FR=ÅMÅŽÕÑ&dchild=1&keywords=arduino+mini+3.320&qid=4444+mini+3.320&qid=

Thank you

dgatf commented 3 years ago

I tested without success

Download and flash the latest code

Check that ESC data is connected to pin 7

Check that line 30 in config.h is:

#define ESC_SERIAL softSerial

I don't know how to use the debug.

Also connect ESC GND to Arduino GND

Enable ESC debug mode in config.h uncommenting line 107:

#define DEBUG_ESC

Open Serial Monitor in Arduino IDE at 115200bps. Check the output. You should see something like this:

DEBUG
V0.8.0
PN: 40 RPM: 123456.00 Volt: 11.94 Curr: 2.85 tempFET: 35.59 tempBEC: 35.59

So, is this model the right one?

Yes, but I recommend to try debug mode before, to discard any other issue

J-charles-C commented 3 years ago

i,

On serial monitor, i have only :

⸮⸮⸮⸮⸮ DEBUG V0.8.0

dgatf commented 3 years ago

Then if the connections are ok, definitely your board is not reading the ESC. Go buy the Mini 3.3v. Note you'll need a USB-TTL programmer

I'm still surprised that is not working even with softwareserial. You could also post a picture of the connections to check if everything is ok

J-charles-C commented 3 years ago

IMG_5811

dgatf commented 3 years ago

Ok, looks good. Last check...

Upload the sketch under tools folder sniffer

Be sure you change the pin in line 10:

#define PIN_SNIFFER 7

Connect the ESC to the Arduino and open a serial monitor at 19200bps and check the output. If there is no output, absolutely sure your board is not reading the ESC

J-charles-C commented 3 years ago

Ok,

INIT 20:13:19.993 -> ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮

Nothing else

dgatf commented 3 years ago

Which firmware version is installed in your ESC? You may try with another version. See post

Some firmware versions may not be sending telemetry

J-charles-C commented 3 years ago

I have the 160A HV with the latest firmware.

On the other hand, when I connect my ESC to my receiver, I have the RPMs.

thanks

dgatf commented 3 years ago

Just check it doesn't have the VBAR in the title of the firmware version. See post

On the other hand, when I connect my ESC to my receiver, I have the RPMs.

For this to work the esc has to be connected to the receiver and armed... Do you have telemetry with the Arduino?

J-charles-C commented 3 years ago

Good evening. The firmware for Vbar does not exist for my esc. I order the arduino in 3.3v. thanks