execuc / v202-receiver

v202 2.4G arduino receiver
MIT License
62 stars 19 forks source link

Stuck on BIND IN PROGRESS #4

Closed bluse7en closed 7 years ago

bluse7en commented 7 years ago

Hi,

I have a jjrc h28 with v202 protocol, but I'm unable to bind and stuck on "Bind in progress". I'm using jjrc h28 transmitter and salvage the receiver radio and solder it to arduino uno r3. Do I anything wrong or something?

Thank You

execuc commented 7 years ago

Hi,

I'm not sure I understand it. Did you connect a NRF24L01+ module to the arduino or a module from your original transmitter ?

bluse7en commented 7 years ago

I connect a module from the original receiver to the arduino

execuc commented 7 years ago

Could you add some Serial.Println("Step X") where X is an number or any log you want in the code to determine where program is blocked. Maybe there is a problem to communicate with the 2.4G module.

bluse7en commented 7 years ago

I've done it already, and the arduino keep printing "Wait_First_Syncro"

execuc commented 7 years ago

So, I think arduino manage to speak with the module because it receives the bind frame. Maybe algorithm to determine frequencies used for frequency hopping have a problem. On WAIT_FIRST_SYNCHRO case, we wait on the first frequency, could you test another frequency changing 'mRfChNum = 0' value, line 240 ? Also, after binding, do you move up and down the throttle joystick ?

bluse7en commented 7 years ago

I've done the up and down procedure, but still no different :( with the value of what should I change on line 240?

matrix31415 commented 7 years ago

I am also stuck on this Bind in Progress, I am very determined to figure this out however I am stuck. IF blue7en or the creator can give me any tips on how to proceed I would be forever grateful. I really need to get this project working and just need a little help. Let me know if you guys figure this out. -Thank you so much!

execuc commented 7 years ago

Hello, could you please tell me with which transmitter you test it. At bind in progress state, program wait forever at the first channel maybe there are problem with it. Could you change line 243 to = BOUND? It will not wait the first synchro after throttle down and up and it will test others channels. BOUND state jump to next channels if no message arrived after timeouts.

matrix31415 commented 7 years ago

I am using the Syma X8W Transmitter, The is the same transmitter that this guy: https://www.youtube.com/watch?v=vWv1shiZPkg is using. Now I am using a copy of Suxmen's version of your code: (https://github.com/Suxsem/symaxrx) However, his is almost identical to yours. I am at school right now and I can test this later tonight when I get home.

-Thank you for helping me figure this out.

matrix31415 commented 7 years ago

I believe in his code: https://github.com/Suxsem/symaxrx/blob/master/symax_protocol.cpp It is line 178 correct?

execuc commented 7 years ago

I didn't understand that your Syma is not a v202 protocol. The change of line 243 will not work because his code does not jump to another channels after timeout. I have made this modification some months ago. Are you sure your transmitter has the same protocol as Suxsem use?

matrix31415 commented 7 years ago

I am not 100% sure but in that video, he uses a Syma X8 remote with Suxsem's code/protocol. So I am very sure this will work. I have been trying to talk to Suxsem, however I do not think I can send private messages on here without paying. So I can only hope he logs in and checks issues on older projects. I thought I would ask you because most of his code is yours, just slightly modified.

execuc commented 7 years ago

Sometimes algorithms to determine rf channels used for frequency hooping are different... I take a look to his code and i was wrong there is a timeout to change channel. So test the modification l.178 to check others channels and tell me if it works. If not, test all nrf24 channels because tx id seems ok.

matrix31415 commented 7 years ago

Ohhhh okay, I understand. So I am changing: (mState = WAIT_FIRST_SYNCHRO;) on line 178 to (mState = BOUND;)

This will force it to look on different channels?

matrix31415 commented 7 years ago

If you are interested, here is a video I made of my problem: https://www.youtube.com/watch?v=DsRIDRRwq98

matrix31415 commented 7 years ago

Okay, I just changed the line and it still did not Bind... I have a question.

In your setup, you have this as part of the sketch: void setup() { // SS pin must be set as output to set SPI to master ! pinMode(SS, OUTPUT); Serial.begin(115200); // Set CS pin to D7 and CE pin to D8 wireless.setPins(8,7); protocol.init(&wireless);

Is that all I needed to do before I uploaded it to the Arduino?

  1. Set the pins to 8,7 and keep SS, OUTPUT the same?
    I guess what I am asking is, what are the things that users need to change BEFORE they upload the sketch?
matrix31415 commented 7 years ago

Hey, I just wanted to update you, I figured it out. I tried what you mentioned above with switching the channel and after I changed the 0 to 1 everything worked. I was able to control a servo. :D Thank for the help though, I really do appreciate it!!

execuc commented 7 years ago

You are welcome. I am glad if this workaround works. Maybe there is a problem with this channel 0 in the frequencies loop but with the timeout it switch to the next working channel. But if you don't feel latency problem it is OK.

bluse7en commented 7 years ago

I didn't successfully with jjrch h28 2.4Ghz Rx and Tx chip, but I do success with cheerson cx-30w 2.4Ghz transmitter chip and pair with jjrc h28 2.4Ghz Rx chip. So, my jjrc h28 transmitter isn't fully compatible with v2x2 protocol maybe? here is the diagram : Arduino(TX) > bk2421(salvage from cx-30w Tx > jjrc h28 rx chip > Arduino (Rx) The TX code I took from rivig github but now, I'm suffering an intermitten connection between those radio. Any suggestion?