Cleric-K / vJoySerialFeeder

Feed Virtual Joystick driver with data from a serial port
GNU General Public License v3.0
258 stars 55 forks source link

[FIXED] Serial Port Read Timeout #24

Closed zus0 closed 5 years ago

zus0 commented 5 years ago

When I plug in my FS-A8S to PC via USB to UART/Arduino nano it appears as COM port, but when I select COM port in app, it says "Connected, Failsafe (Serial Port Read Timeout)" I've tried everything I could find. LED on receiver is blinking. Plz help me with this

Cleric-K commented 5 years ago

If the LED is blinking this means that there's no connection with the transmitter or it is not bound.

A8S does not send any data over the serial port if there's no active connection with the transmitter.

Make sure the rx is bound (LED should be glowing without blinking) and try again in vjsf.

zus0 commented 5 years ago

No, I just forgot to mention it. When I turn on my transmitter, LED starts to glow permanentry.

zus0 commented 5 years ago

Is it possible, that my receiver is broken? P.S. When I connect receiver to arduino, TX light glows

Cleric-K commented 5 years ago

Is it possible that your transmitter is configured for SBUS ? What kind of transmitter are you using?

zus0 commented 5 years ago

I'm using FS-i6 (without X). As far as I know, it has only i-BUS.

zus0 commented 5 years ago

https://vimeo.com/343556588 I hope this might be useful

Cleric-K commented 5 years ago

The settings in the tx are somewhere in the RX settings, where you can choose between PPM/PWM - the should be also ibus/sbus.

You can try dumping some data with: https://hw-server.com/terminal-terminal-emulation-program-rs-232 in HEX format. Thus we may see if it is really sending valid IBUS frames.

image

If it really sends SBUS you can either switch to IBUS or you can try also with https://github.com/Cleric-K/vJoySerialFeeder/blob/master/Docs/Sbus.md you'll have to flash your arduino with the sketch there and connect as described.

zus0 commented 5 years ago

So, I managed to get this working. Somehow my receiver was really working in SBUS mode. I just held bind button on my receiver for 2 seconds, when transmitter is on and connected, and it switched back to IBUS mode. Sorry to bother you.

SaltyPea commented 4 years ago

I have the same problem, and not exactly sure where to tell if its IBUS or SBUS. Can someone help me out?

Cleric-K commented 4 years ago

Have you tried holding the bind button switch between protocols?

SaltyPea commented 4 years ago

how would I do that?

Cleric-K commented 4 years ago

See https://github.com/Cleric-K/vJoySerialFeeder/issues/24#issuecomment-504443094

NigelLowe commented 4 years ago

Hi. I've also been having this issue but when I try to dump the protocol data nothing appears (log shows nothing between the dashed lines). Both the RX and TX LEDs are on and I've tried changing between IBUS and SBUS modes but still nothing. I've tried 2 different usb cables that work for hard drives on 2 different computers and am able to upload sketches. I'm using an Arduino nano and a Flysky FS-A8S receiver. Would anyone know why this is the case?

Cleric-K commented 4 years ago

Are you using the Arduino just for UART convertor (for IBUS)? Or you are trying to use it with SBUS and the sbus invert sketch?

NigelLowe commented 4 years ago

I have tried both ways. But preference is for IBUS

Cleric-K commented 4 years ago

Ok, to reiterate just to make sure we are not missing something: For IBUS:

  1. Arduino should should be cleared - flash empty sketch.
  2. Received should be connected to the Arduino TX pin.
  3. Receiver should be in IBUS mode
  4. Test as in https://github.com/Cleric-K/vJoySerialFeeder/issues/24#issuecomment-504308045
NigelLowe commented 4 years ago

Went through those steps again and still no output. I also get no output when connecting through Putty like in the vimeo link above your photo (sorry dont know how to link). Arduino is flashed with eeprom_clear, IBUS wire from reciever connected to TX pin and receiver is in IBUS mode.

Cleric-K commented 4 years ago

Are you sure the receiver works ok? Have you tested with flight controller? Is your transmitter ON?

NigelLowe commented 4 years ago

Yes to all of those. Connected the receiver back to the flight controller earlier and it worked. Transmitter is on and both RX and TX LEDs are on

Cleric-K commented 4 years ago

It is little strange that RX led is also ON. There should not be any activity there, IBUS is one way communication.

Can you try flashing from Arduino Examples/04.Communications/SerialEvent ?

Then open the Serial Monitor (Tools/Serial Monitor), make sure speed is 9600 and you have NewLine for line ending. Here you should be able to write something to the input at the top end press Enter the board should echo back the same text.

NigelLowe commented 3 years ago

This works but still getting nothing from the terminal. I think I should also mention in the terminal, it says 'Connected' at the bottom but both Rx and Tx are 0. Nothing else at the bottom.

Could it be that there is something wrong with the Arduino or cable? I'm new to this so really have no idea

Cleric-K commented 3 years ago

The Arduino sketch echoes back data once it receives NEWLINE character (also called LF - LineFeed). By default the terminal program does not implicitly send LF on Send. Do this: image Now echo should work.

When +CR checkbox is OFF (next to the Send button), when you enter some text to send and click Send you should see the TX counter going up. Also you should see on the Arduino ONLY the RX led flashing. After you check +CR and Send again you should receive the echo back - RX count should increase and TX and RX leds should both flash (technically RX lights first and then Arduino sends echo and TX lights but it happens so fast that they both seem to flash at the same time)

Either way it seems everything is OK with the Arduino. I'm not sure what could be the problem. Are you sure you have GND connected between the arduino and receiver?

NigelLowe commented 3 years ago

Everything's working now. Not sure why this works, but up until now I was powering on the Arduino and then after a few seconds connecting the receiver because one youtube video said there was a risk doing otherwise. When I power the Arduino with the receiver initially connected everything is as expected. Thank you so much for your time and debugging.

Cleric-K commented 3 years ago

That's strange. There shouldn't be any difference. But anyway, I'm glad it's finally working!

NigelLowe commented 3 years ago

Yeah, I wouldn't think there would be a difference but I'm able to replicate getting no output when the receiver is not attached initially

MikeJ16 commented 3 years ago

Hi, I'm also getting this error but I think it might be because I am using an old JR max 662 (35mhz), would it be able to work, if so how, and also what is the correct Protocol to use for this transmitter?

Any help would be greatly appreciated.

Cleric-K commented 3 years ago

I have no idea what that is. Are you sure the receiver works with IBUS?

MikeJ16 commented 3 years ago

Thanks for the reply, The receiver does not have IBUS so I used the DSC port of the transmitter with 3.5 mm audio jack with some some wires at the end and plugged it straight into the Arduino.

Cleric-K commented 3 years ago

But what Arduino sketch are you using? Do you convert the PPM signal in some way to IBUS?

MikeJ16 commented 3 years ago

I am not using any Arduino sketch at the moment, is there a sketch that I need to upload?

Cleric-K commented 3 years ago

Yes, check out @wdcossey https://github.com/wdcossey/ppm-to-ibus-serial

Cleric-K commented 3 years ago

Be aware, though, that PPM adds in itself 8-10ms latency and this is definitely felt in simulators. Using digital receiver is the best option.