{"id":20161617,"url":"https://github.com/openipc/mavfwd","last_synced_at":"2025-04-10T00:14:59.134Z","repository":{"id":137308537,"uuid":"567258526","full_name":"OpenIPC/mavfwd","owner":"OpenIPC","description":"Simplest MAVLink serial port to UDP forwarder in pure C","archived":false,"fork":false,"pushed_at":"2025-03-20T11:40:40.000Z","size":664,"stargazers_count":16,"open_issues_count":1,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T00:14:47.682Z","etag":null,"topics":["fpv","openipc","openipc-fpv"],"latest_commit_sha":null,"homepage":"https://openipc.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenIPC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"openipc"}},"created_at":"2022-11-17T12:15:37.000Z","updated_at":"2025-04-04T03:34:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"cb229754-2aab-4da5-8040-8a1e2036050f","html_url":"https://github.com/OpenIPC/mavfwd","commit_stats":{"total_commits":21,"total_committers":7,"mean_commits":3.0,"dds":0.5714285714285714,"last_synced_commit":"e7df14a4e334391019041d3df3119fe0b3845962"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fmavfwd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fmavfwd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fmavfwd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenIPC%2Fmavfwd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenIPC","download_url":"https://codeload.github.com/OpenIPC/mavfwd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131317,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fpv","openipc","openipc-fpv"],"created_at":"2024-11-14T00:19:48.442Z","updated_at":"2025-04-10T00:14:59.102Z","avatar_url":"https://github.com/OpenIPC.png","language":"C","funding_links":["https://opencollective.com/openipc"],"categories":[],"sub_categories":[],"readme":"## MAVFWD\n\nAdded stream parsing with official mavlink library.\n\n**mavfwd** is a utility for broadcasting a mavlink telemetry stream between wifibroadcast and uart devices, for organizing one- or two-way telemetry between UAV and ground station. \n\n**mavfwd** is included in the OpenIPC FPV firmware as a lighter alternative to mavlink routerd and is usually used on the air part (camera).\n\nAlso, **mavfwd** can monitor the mavlink RC _CHANNELS package, and call the script `channels.sh` (located at /usr/bin or /usr/sbin) passing the channel number and its value to it when changing as $1 and $2 parameters. An example of channels.sh is present.\n\nThis allows for controlling the camera via the Remote Control Transmitter\n\n```\nUsage: mavfwd [OPTIONS]\n-m --master      Local MAVLink master port (%s by default)\n-b --baudrate    Serial port baudrate (%d by default)\n-o --out         Remote output port (%s by default)\n-i --in          Remote input port (%s by default)\n-c --channels    RC Channel to listen for commands (0 by default) and call channels.sh\n-w --wait        Delay after each command received(2000ms defaulr)\n-a --aggregate   Aggregate packets in frames (1 no aggregation, 0 no parsing only raw data forward) (%d by default) \n-f --folder      Folder for file mavlink.msg (default is current folder)\n-p --persist     How long a channel value must persist to generate a command - for multiposition switches (0ms default)\n-t --temp        Inject SoC temperature into telemetry(HiSilicon and SigmaStart supported)\n-j --wfb         Reports wfb_tx dropped packets as Mavlink messages. wfb_tx console must be redirected to \u003ctemp\u003e/wfb.log\n-v --verbose     Display each packet, default not       \n--help         Display this help\n```\n\n### Example :\n\n```mavfwd --master /dev/ttyAMA0 --baudrate 115200 --out 192.168.1.20:14550 -c 7 -w 3000 -a 10 -t -f /tmp/```\n\nWill read on the first UART with baudrade 115200 and will listen for values in RC channel 7 that come from the Remote Control via Flight Controller.\n\nEvery time the value is changed with more than 5% the bash script `channels.sh {Channel} {Value}` will be started with params.\n\nThe script then can check the Value param (usually between 1000 and 2000) and do the tasks needed - reconfigure encoder, switch IR mode, restart WiFi, change MCS index. etc.\n\nTo protect the system from overloading (when rotating a pot on the Tx ), the script will not be started again for 3000ms.\n-p option is useful for rotary switches, where each switch step will generate a command till the desired one is reached. \n\nIn order to avoid this, the channel value must keep its value for a given period in order to be accepted, for example 1000ms. \n\nThis way if you never stay more than a second on a step of the rotary switch while rotating it, only the last one will be accepted. The drawback is the delay this options adds.\n\nPackets will be aggregated in chunks of 10 into one UDP frame. \n\nA MAVLINK_MSG_ID_ATTITUDE from the FC will flush the buffer. \n\nThis way the OSD will be updated with the same rate and no lag will be added.\n\n` -a 15` : will flush the cached messages into one UDP packet after count of message reaches 15\n\n` -a 1024` : will flush the cached messages into one UDP packet total length of all message reaches 1024 bytes\n\nIn both cases the buffer will be flushed if there are at least 3 packets and a MAVLINK_MSG_ID_ATTITUDE is received.\n\nTemperature will be read from the board and will be injected into the mavlink stream each second via MAVLINK_MSG_ID_RAW_IMU 27 message.\n\nOption to send text from the cam. The file mavlink.msg in {tempfolder} is monitored and when found, all data from it are send \nas plain text message via MAVLINK_MSG_ID_STATUSTEXT 253 to the ground station and the file is deleted.\n\n### Sample:\n\necho \"Huston, this is IPC\" \u003e/tmp/mavlink.msg\n\nkillall -usr1 mavfwd   # will send text message to ground station even no data are received in the serial port, can be used to test Camera to Ground connection.\n\nwfb reporting scans /tmp/wfb.log file every second and extract values from \"UDP rxq overflow: 2 packets dropped\" lines. \n\nwfb_tx stdout must be redirected to this file, like this : \n\n```wfb_tx -p ${stream} -u ${udp_port} -R 512000 -K ${keydir}/${unit}.key -B ${bandwidth} -M ${mcs_index} -S ${stbc} -L ${ldpc} -G ${guard_interval} -k ${fec_k} -n ${fec_n} -T ${pool_timeout} -i ${link_id} -f ${frame_type} ${wlan} 2\u003e\u00261 | tee -a /tmp/wfb.log \u0026```\n\nIn order to cross-compile for a specific camera., pull OpenIPC locally and compile it for the desired chipset.\n\nAssuming it is compiled in ```/home/home/src/openipc```, then **mavfwd** can be compiled and copied to cam with IP 192.168.1.88 like this:\n```\ncp mavfwd.c /home/home/src/openipc/output/build/mavfwd-220d30e118d26008e94445887a03d77ba73c2d29/\nmake -C /home/home/src/openipc/output/ mavfwd-rebuild\nscp /home/home/src/openipc/output/build/mavfwd-220d30e118d26008e94445887a03d77ba73c2d29/mavfwd root@192.168.1.88:/usr/bin/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenipc%2Fmavfwd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenipc%2Fmavfwd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenipc%2Fmavfwd/lists"}