-
Notifications
You must be signed in to change notification settings - Fork 35
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
MultiWii 2.4 Nav 7 initial connection is ok, but how to slow down MSP communications. #54
Comments
Are you using a virtual machine (VirtualBox for example)? Although I no longer use mwp with multiwii, I do test with a MW board, and there are no comms errors in (my) native environment. Anyway, nice that someone is trying to use it with MW, I suspect we will find some real bugs due to 'inav assumptions'. |
You can always invoke mwp with |
And it really helps if you build mwp from a cloned git repository, then we get the commit version in the log. |
Ok, hi, @stronnag. 1. I dont use virtualbox, i use "true" pc with linux mint 19. Also i have build mwptools from source from github. I have some raw logs (link bellow). Now i have only one idea. In the beginning of raw file i see "v2". As i can understand it means that mwp uses MSP v2 protocol to communicate with FC. But, i have old MultiWii 2.4 based on AVR, and it has MSP v1. In protocol.cpp (here: https://github.com/multiwii/multiwii-firmware/blob/upstream_shared/Protocol.cpp) i can see ever: Link to raw: https://yadi.sk/d/evDdqiuWzhkIeQ |
Thanks. mwp talks MSP v1 to MSP v1 clients (like MW, old iNav) and MSP v2 to modern iNav. It is auto-detected. The v2 in the raw log refers to the log file format (as I add a version string it when we introduced MSPv2), as it was necessary to modify the record header to accommodate that MSPv2 can be longer than 256 bytes. So to your log, there is a tool
So, at For reference, my old, 2014-era Multiwii board works perfectly with mwp; so far it's been running for just over 15 minutes and processed almost 60000 MSP messages.
No, the problem is that your board stops responding to MSP. |
Thanks a lot! I will try to analyze communication. One question: How i can reduce frequency of communication? I mean add little delay between any two MSP commands from mwp to FC:
|
I guess, I find my problem. MWP works perfect, problem in my hardware. I use custom GPS through additional SoftwareSerial. I check around interrupts for it, but not for UART ISR. When FC receive NMEA messages from GPS it cant answer to mwp. I think MSP packets may to be brocken this period. In EOSBandi's WinGUI and MultiWiiConf its work, because those apps have another communication logic. WinGUI has default RX/TX frequency 5Hz, MultiWiiConf - about 50Hz (I think). And both apps try to restore communication on its frequency - when there is no answer from FC, MultiWiiConf and WinGUI dont wait 1 sec before retry. And I see like everything is OK. And more, GPS NMEA comes every 1 sec. And MSP retrys comes from mwp every 1 sec too. And I think, this conflict repeats several periods, until time moments do not shift due to the difference in the generators. I dont have osciloscope yet to check my hypothesis. Can You give me a link to the code region, where i can reduce retry interval (just for my version of mwp) and check my hypothesis. I hope my idea is clear - sorry for my English. |
I'm pleased you've found the issue. mwp does not work in the same way as WinGui or MWConf; it is (strictly) event driven and sends the next MSP request as soon as it has received /processed the previous response. This was to avoid issues (overflows, lost messages in the FC) caused by having a fixed timer. There is a 'house-keeping' timer that checks for lost messages. This runs every 100ms. You can change how frequently the 'no response' check occurs by configuration.
However, my guess is that this probably doesn't help; it may be that rather than sending each request in a single
I changed the title to more closely reflect the problem we're trying to solve. |
OK, thanks! I change poll-timeout to 130ms and it reduce freezes very well. Not 100%, but its usable now. Its enough for me, i think. GPS data has more priority and i cant do nothing - just drop some MSP messages. Close the issue. I have another problem yet, may be it is not issue, but i need some help. Where i can ask you about upload mission procedure of mwp (I dont think "issues tab" is a right place for it - i think it is a not mwp issue)? What means notices: "Validation WPx fails for P1" and "Validation WPx fails for FLAG"? |
I find problem. It was my mistake. I dont use a baro and incorrectly commented out on altitude parameter in packet. Now it works perfectly. Thank you, man! About my project. I create a very very simple (shortest and clearness program) version of old MultiWii for fixed hardware and just for rovers/boats for K-12 pupils (12-16 years old). And education program based on it. They must understand how work IMU, navigation, RX and servo output. They build electronics from modules like arduino mini, GY-521, and ESP8266, write some code, and take part in the competition. |
Cool school programme, good luck with it. Wish I had things like that when I was at school (some time ago, we sent off handwritten programs (for punched cards / paper tape) via the mail steamer to the nearest university timeshare computer on the mainland). Three weeks later, the mail steamer returned a print out ("syntax error at line 2"). |
I have old multiwii 2.41 nav version 7. MWPtools successfully connects to it, but it has a lot msp timeouts and freezes:
... and so on.
I use usb to serial converter. In EOSBandi's WinGUI for MW works better, but i need change nav version 7 to 5 and firmware version to 2.30. And it does not upload missions.
I hope on mwptools.
The text was updated successfully, but these errors were encountered: