{"action":"created","issue":{"url":"https://api.github.com/repos/PX4/Firmware/issues/5028","repository_url":"https://api.github.com/repos/PX4/Firmware","labels_url":"https://api.github.com/repos/PX4/Firmware/issues/5028/labels{/name}","comments_url":"https://api.github.com/repos/PX4/Firmware/issues/5028/comments","events_url":"https://api.github.com/repos/PX4/Firmware/issues/5028/events","html_url":"https://github.com/PX4/Firmware/issues/5028","id":164891683,"number":5028,"title":"MavLink unstable","user":{"login":"vvranjek","id":9812245,"avatar_url":"https://avatars.githubusercontent.com/u/9812245?v=3","gravatar_id":"","url":"https://api.github.com/users/vvranjek","html_url":"https://github.com/vvranjek","followers_url":"https://api.github.com/users/vvranjek/followers","following_url":"https://api.github.com/users/vvranjek/following{/other_user}","gists_url":"https://api.github.com/users/vvranjek/gists{/gist_id}","starred_url":"https://api.github.com/users/vvranjek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvranjek/subscriptions","organizations_url":"https://api.github.com/users/vvranjek/orgs","repos_url":"https://api.github.com/users/vvranjek/repos","events_url":"https://api.github.com/users/vvranjek/events{/privacy}","received_events_url":"https://api.github.com/users/vvranjek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-11T17:32:04Z","updated_at":"2016-07-12T14:36:22Z","closed_at":null,"body":"I had a few issues with mavlink lately. I have a custom mavlink message called CAP_STATUS that I configured to be sent every second. It was working fine until WIND_COV got implemented. After that I suddenly stopped receiving the message (I would randomly receive it every minute or so) and couldn't figure out why. The `mavlink_msg_cap_status_send_struct(_mavlink->get_channel(), &msg);' was executed every second, but the message just wasn't sent/delivered. Then I realized that if I change the send rate to anything but 1.0,  everything worked fine. I tried 1.1, 0.9, 5.0, 10.0, everything works as expected. I also tried changing other rates, that were set to 1.0 seconds with positive results. Here are a few working and non-working configurations:\r\n\r\nNot working:\r\n```\r\n                configure_stream(\"SYS_STATUS\", 1.0f);\r\n\t\tconfigure_stream(\"ATTITUDE\", 15.0f);\r\n\t\tconfigure_stream(\"GPS_RAW_INT\", 3.0f);\r\n\t\tconfigure_stream(\"GLOBAL_POSITION_INT\", 3.0f);\r\n\t\tconfigure_stream(\"CAP_STATUS\", 1.0f);\r\n\t\tconfigure_stream(\"VFR_HUD\", 2.0f);\r\n\t\tconfigure_stream(\"EXTENDED_SYS_STATE\", 1.0f);\r\n\t\tconfigure_stream(\"WIND_COV\", 1.1f);\r\n```\r\nWorking:\r\n```\r\n                configure_stream(\"SYS_STATUS\", 1.1f);\r\n\t\tconfigure_stream(\"ATTITUDE\", 15.0f);\r\n\t\tconfigure_stream(\"GPS_RAW_INT\", 3.0f);\r\n\t\tconfigure_stream(\"GLOBAL_POSITION_INT\", 3.0f);\r\n\t\tconfigure_stream(\"CAP_STATUS\", 1.0f);\r\n\t\tconfigure_stream(\"VFR_HUD\", 2.0f);\r\n\t\tconfigure_stream(\"EXTENDED_SYS_STATE\", 1.2f);\r\n\t\tconfigure_stream(\"WIND_COV\", 0.9f);\r\n```\r\nWorking:\r\n```\r\n                configure_stream(\"SYS_STATUS\", 1.0f);\r\n\t\tconfigure_stream(\"ATTITUDE\", 15.0f);\r\n\t\tconfigure_stream(\"GPS_RAW_INT\", 3.0f);\r\n\t\tconfigure_stream(\"GLOBAL_POSITION_INT\", 3.0f);\r\n\t\tconfigure_stream(\"CAP_STATUS\", 1.1f);\r\n\t\tconfigure_stream(\"VFR_HUD\", 2.0f);\r\n\t\tconfigure_stream(\"EXTENDED_SYS_STATE\", 1.0f);\r\n\t\tconfigure_stream(\"WIND_COV\", 1.0f);\r\n```\r\n\r\nI added CAP_STATUS to common.xml with ID: 180 and generated mavlink 2.0 libraries. Mavlink versions match. \r\n\r\nI also realized that sometimes mavlink would stop for a second or two and then send all the missed messages really fast. Another case was, when I would receive no CAP_STATUS message (others were working) and all of a sudden a ton of them (50-100) would be sent in no time. Thus mavlink being unstable.\r\n\r\nI know it is hard for others to debug this as the code is modified, but I think the bug is related to the source and can potentially affect other users.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/PX4/Firmware/issues/comments/232067268","html_url":"https://github.com/PX4/Firmware/issues/5028#issuecomment-232067268","issue_url":"https://api.github.com/repos/PX4/Firmware/issues/5028","id":232067268,"user":{"login":"vvranjek","id":9812245,"avatar_url":"https://avatars.githubusercontent.com/u/9812245?v=3","gravatar_id":"","url":"https://api.github.com/users/vvranjek","html_url":"https://github.com/vvranjek","followers_url":"https://api.github.com/users/vvranjek/followers","following_url":"https://api.github.com/users/vvranjek/following{/other_user}","gists_url":"https://api.github.com/users/vvranjek/gists{/gist_id}","starred_url":"https://api.github.com/users/vvranjek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvranjek/subscriptions","organizations_url":"https://api.github.com/users/vvranjek/orgs","repos_url":"https://api.github.com/users/vvranjek/repos","events_url":"https://api.github.com/users/vvranjek/events{/privacy}","received_events_url":"https://api.github.com/users/vvranjek/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T14:36:22Z","updated_at":"2016-07-12T14:36:22Z","body":"Ok, so I managed to reproduce a similar bug on master (817f695), which is most likely related. Here is how to reproduce it:\r\n```\r\ngit checkout 817f695\r\nmake clean\r\nmake submodulesclean\r\n```\r\n\r\nComment the following drivers otherwise there is not enough flash\r\n```\r\n\t##drivers/frsky_telemetry\r\n\t##drivers/px4flow\r\n\t##drivers/gimbal\r\n```\r\nThe only changes I made is set all mavlink streams in mode 'Normal' to 1.0f as such:\r\n```\r\nconfigure_stream(\"SYS_STATUS\", 1.0f);\r\n\t\tconfigure_stream(\"EXTENDED_SYS_STATE\", 1.0f);\r\n\t\tconfigure_stream(\"HIGHRES_IMU\", 1.0f);\r\n\t\tconfigure_stream(\"ATTITUDE\", 1.0f);\r\n\t\tconfigure_stream(\"RC_CHANNELS\", 1.0f);\r\n\t\tconfigure_stream(\"SERVO_OUTPUT_RAW_0\", 1.0f);\r\n\t\tconfigure_stream(\"ALTITUDE\", 1.0f);\r\n\t\tconfigure_stream(\"GPS_RAW_INT\", 1.0f);\r\n\t\tconfigure_stream(\"ADSB_VEHICLE\", 1.0f);\r\n\t\tconfigure_stream(\"DISTANCE_SENSOR\", 1.0f);\r\n\t\tconfigure_stream(\"OPTICAL_FLOW_RAD\", 1.0f);\r\n\t\tconfigure_stream(\"VISION_POSITION_NED\", 1.0f);\r\n\t\tconfigure_stream(\"ESTIMATOR_STATUS\", 1.0f);\r\n\t\tconfigure_stream(\"NAV_CONTROLLER_OUTPUT\", 1.0f);\r\n\t\tconfigure_stream(\"GLOBAL_POSITION_INT\", 1.0f);\r\n\t\tconfigure_stream(\"LOCAL_POSITION_NED\", 1.0f);\r\n\t\tconfigure_stream(\"POSITION_TARGET_GLOBAL_INT\", 1.0f);\r\n\t\tconfigure_stream(\"ATTITUDE_TARGET\", 1.0f);\r\n\t\tconfigure_stream(\"HOME_POSITION\", 1.0f);\r\n\t\tconfigure_stream(\"NAMED_VALUE_FLOAT\", 1.0f);\r\n\t\tconfigure_stream(\"VFR_HUD\", 1.0f);\r\n\t\tconfigure_stream(\"WIND_COV\", 1.0f);\r\n```\r\nafter that:\r\n```\r\nmake\r\nmake -C build_px4fmu-v2_default upload\r\n```\r\n - Take out SD card, just to make sure nothing is interfering\r\n - Open console on serial 5 and run\r\n```\r\nmavlink stop-all\r\nmavlink start -d /dev/ttyS1 -b 115200 -m normal\r\n```\r\n - Open qGCS and connect to this port.\r\n - Open MavLink Inspector\r\n\r\nNow you should see that all messages received are at 0.5Hz (instead of 1.0Hz) except the heartbeat, which is at 1.0Hz. This isn't exactly the bug I originally posted, but is most likely related and should be reproducible. \r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"vvranjek"}}