alduxvm / pyMultiWii

MultiWii Serial Protocol (MSP) API to send and receive data from firmware using MSP
GNU General Public License v3.0
153 stars 84 forks source link

Error with sendCMD #19

Closed HardVeur closed 5 years ago

HardVeur commented 6 years ago

It seems like the ord() get a int instead of a character that’s what cause the error in my case any suggestions to fix this problem?

nik012003 commented 6 years ago

Are you using python2.6 ? What FC/software are you using? I think I had the same problem as yours, try to use my version of pyMultiWii(It's on my github) and see if it works for you.

18

HardVeur commented 6 years ago

Wait did you use python 3.6 cause I did and I couldn’t see any methods which probably behave different from the 2.6 version. So I thought it should also work with 3.6 but lessons learned i didn’t. Do you mean the version of multiwiiMSP you posted in your issue???

HardVeur commented 6 years ago

I use the CF 2.2.0 wich i flashed on my CC3D but someone from the CF-Forum told me that 2.2.0 CF doesn’t support serial rx (MSP) anymore. Could you explain how do you got your whole set up run and how does your setup look like? I really would appreciate that, thank you.

nik012003 commented 6 years ago

I haven't test serialrx yet, but the option is there on CF 2.2.0 on the SeriuslyPro F3. I'm able to get data(ATTITUDE,ALTITUDE,etc...) from my FC via python 2.6 (the lib is incompatible with 3.6). The only thing I got enabled on the CF configurator is MSP on the USB(UART1 in my case). When I'm not busy I'll try to get serialrx to work, but I think it needs a separate UART connection. I'll keep you updated.

alduxvm commented 6 years ago

Yes, I created the library with support only for 2.7, if someone needs to support 3, then it will have to be re-done...

HardVeur commented 6 years ago

Thank you guys for the help. I try hard to get my setup run. I have a CC3D and try to get a list with 4 integers on my raspberry pi to my CC3D with Cleanflight version 2.1.0 (I said 2.2.0 before that was a mistake it’s 2.1.0). How to get the list with throttle, yaw, roll and pitch from my raspberry to my CC3D doesn’t matter as long as I get it done and I’m ready to flash any firmware to my CC3D as long as I get this run. Any suggestions how to do it? I already tried to use the MuliWii python class with sendCMD(8, MultiWii.SET_RAW_RC, [throttle, yaw, pitch, roll]) but it didn’t worked I also tried sendCMDreceiveATT and it didn’t worked either I just get none as respond. How to get the list from raspberry pi to CC3D should I flash a specific version of Betaflight to my CC3D?

nik012003 commented 6 years ago

I also got None in my tests, I fixed the problem with this PR #18 . Try to use my version and see if it fixes your issue. To to that you should: 1)Uninstall old lib with: pip uninstall pymultiwii 2)Download my version of the lib: git clone https://github.com/nik012003/pyMultiWii.git 3)Install my version: cd pyMultiWii && pip install .

HardVeur commented 6 years ago

Actually I just tried your version and never the original one. But your changes just give the board a couple of seconds to start. So I thought it can’t be wrong to just test yours or do they also something else I don’t remember the exact changes right now?!

nik012003 commented 6 years ago

My version changes a bit the way the board connects and works perfectly in my setup. I have got only one FC to test with so I don't know if it works on other FCs. Maybe you could give alduxvm's version a try and see if that works for you. BTW I would suggest that you change your CC3D to a newer board, with more powerful processors, like the F3,F4 or the F7.

BluDay commented 6 years ago

I'm aware that I'm commenting half a year later.

If anyone is still interested with controlling your MultiWii based drone, I can gladly inform everyone that I've made a module for Python 3. Check my profile...

Just make sure to share my work to the MultiWii community...

@alduxvm You have my thanks for your hard work and effort.

nik012003 commented 6 years ago

Thank you very much @engineer-186f ! Have you tested it with betaflight/CF/iNav? I'll try it on my quad as soon as possible!

BluDay commented 6 years ago

@nik012003 I've only tested it without any systems like CF or Betaflight and it works just fine. I can test it with these systems and update and later update the description of my script.

nik012003 commented 6 years ago

@engineer-186f it seems to get all the data from Betaflight-based systems too! But I haven't tested sending data yet. download

BluDay commented 5 years ago

@nik012003 That's great! I'm planning on implementing almost all necessary functions and operations for the board itself, including WP navigation and much more.

LevanSanadiradze commented 5 years ago

I tried @engineer-186f 's module on python 3.7 with Betaflight and it didn't work for me. For those who experience the same problem you can use my code #27

BluDay commented 5 years ago

@LevanSanadiradze

Can you elaborate any further?

Multiple users have reported my module to be fully functional, even with CF/BF.

Try to configure your BF firmware settings...