{"id":15,"date":"2013-04-04T09:20:45","date_gmt":"2013-04-04T09:20:45","guid":{"rendered":"http:\/\/alpsayin.com\/new\/?page_id=4"},"modified":"2021-03-22T21:22:09","modified_gmt":"2021-03-22T21:22:09","slug":"setting-up-radiotftp-serverclient-with-radiometrix-bim2a","status":"publish","type":"page","link":"https:\/\/alpsayin.com\/blog\/manuals\/setting-up-radiotftp-serverclient-with-radiometrix-bim2a\/","title":{"rendered":"Setting up Radiotftp Server\/Client with Radiometrix Bim2A"},"content":{"rendered":"<p>You want a simple manual to jump into packet radio networking with radiotftp? You have the Radiometrix Bim2A devices ready at your hand with boards and everything? Just follow this guide thoroughly and you should have no problem.<\/p>\n<h1>What you need for both sides:<\/h1>\n<ul>\n<li>Any linux machine with a USB port and a Linux based operating system with <a title=\"FTDI Chip Drivers\" href=\"http:\/\/www.ftdichip.com\/Drivers\/VCP.htm\" target=\"_blank\" rel=\"noopener\">FTDI USB-Uart driver<\/a>.\u00a0<span style=\"color: #333333; font-style: normal; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;\">During the development we have used Alix 2d13 from <a title=\"Alix\" href=\"http:\/\/pcengines.ch\/alix.htm\" target=\"_blank\" rel=\"noopener\">PcEngines<\/a>. And during development we have installed Voyage-Linux on them<\/span><span style=\"color: #333333; font-style: normal; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;\">. But radiotftp is also tested on <a title=\"Bifrost OS\" href=\"http:\/\/en.wikipedia.org\/wiki\/Bifrost_(operating_system)\" target=\"_blank\" rel=\"noopener\">Bifrost OS<\/a><\/span><span style=\"color: #333333; font-style: normal; font-family: 'Helvetica Neue', Helvetica, Arial, 'Nimbus Sans L', sans-serif;\">.<\/span><\/li>\n<li><a title=\"Radiometrix Bim2a\" href=\"http:\/\/www.radiometrix.com\/content\/bim2a\" target=\"_blank\" rel=\"noopener\">Radiometrix Bim2A<\/a> or similar devices, one for the server one for the client.<\/li>\n<li>Interface card for Bim2A. These cards are not sold anywhere but you can build one very easily on your own. The schematic of such a card is below. If you are only planning to use the card for radiotftp you don&#8217;t need the audio components (i.e. any component\/wire that is connected to the audio block). You can also download a proteus pcb design from <a title=\"Bim2A Uart PCB\" href=\"https:\/\/github.com\/alpsayin\/bim2a_uart_pcb\" target=\"_blank\" rel=\"noopener\">my github repository<\/a>.<\/li>\n<li>A USB TTL UART cable that allows CTS\/RTS signalling with 3.3 V or 5 V signal level. We prefer using <a title=\"FTDI TTL USB UART Cable\" href=\"http:\/\/www.ftdichip.com\/Support\/Documents\/DataSheets\/Cables\/DS_TTL-232R_CABLES.pdf\" target=\"_blank\" rel=\"noopener\">FTDI cables<\/a> for the purpose.<\/li>\n<li>A matched antenna for 70cm band (433 Mhz band). A simple and good antenna is a 70 cm long wire antenna, but you can use a 17.5 cm wire antenna if you want to keep it short.<\/li>\n<li>And finally you have to clone the <a title=\"Radiotftp\" href=\"https:\/\/github.com\/alpsayin\/radiotftp\" target=\"_blank\" rel=\"noopener\">radiotftp software from github<\/a>.<\/li>\n<\/ul>\n<figure id=\"attachment_7\" aria-describedby=\"caption-attachment-7\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/alpenian.alpsayin.com\/blog\/wp-content\/uploads\/2013\/04\/bim2a_schematic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-7\" src=\"https:\/\/alpenian.alpsayin.com\/blog\/wp-content\/uploads\/2013\/04\/bim2a_schematic-300x211.png\" alt=\"Bim2a UART Interface Card Schematic\" width=\"300\" height=\"211\" \/><\/a><figcaption id=\"caption-attachment-7\" class=\"wp-caption-text\">Bim2a UART Interface Card Schematic<\/figcaption><\/figure>\n<h1>Setup:<\/h1>\n<ul>\n<li>Assuming that you cloned the radiotftp software to your home directory, cd into the radiotftp folder.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">cd ~\/\r\ngit clone https:\/\/github.com\/alpsayin\/radiotftp.git\r\ncd ~\/radiotftp<\/pre>\n<ul>\n<li>You should select the ax25 build, so cd into the ax_25 build folder.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">cd ax25_build\/<\/pre>\n<ul>\n<li><span style=\"line-height: 15px;\">It is always good practice to clean and then make. So clean and make.<\/span><\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">make clean &amp;&amp; make<\/pre>\n<ul>\n<li><span style=\"line-height: 15px;\"><span style=\"line-height: 15px;\">If you are seeing &#8220;<\/span><\/span><em>Finished building target: radiotftp<\/em>&#8220;, you are almost good to go. Now \u00a0we are going to create symbolic links to binary files so that we access them anywhere.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">sudo ln -s ~\/radiotftp\/ax25_build\/radiotftp \/usr\/sbin\/radiotftp<\/pre>\n<ul>\n<li>Go to your home directory again and try typing radiotftp, if you get the help text, then you are good to go<\/li>\n<\/ul>\n<pre lang=\"text\" escaped=\"true\">radiotftp sends or listens for a tftp request<\/pre>\n<pre lang=\"text\" escaped=\"true\">legal invocations:\r\n radiotftp_uhf\r\n radiotftp_vhf\r\nBuild Date: Apr 4 2013 12:54:33\r\nUses ax25 link layer\r\nradiotftp mode [-dst] [-b] [-f] terminal [command filename] \r\n mode uhf or vhf -b run in background (EXPERIMENTAL, do NOT use this!)\r\n -f defines a different local filename for put and get\r\n and defines a different remote filename for append and appendline\r\n -dstXXX.XXX.XXX.XXX sends the request to XXX.XXX.XXX.XXX\r\n default is broadcast Local address settings are read from a 'radiotftp.conf' file\r\n Examples: \r\n radiotftp uhf \/dev\/ttyUSB0 \r\n radiotftp uhf -flocalphoto.jpg \/dev\/ttyUSB0 get remotephoto.jpg\r\n radiotftp uhf -flocalmusic.mp3 \/dev\/ttyUSB0 put remotemusic.mp3\r\n radiotftp vhf -dst10.0.0.1 \/dev\/ttyUSB0 appendfile logfile.txt\r\n radiotftp vhf -fremote_sensors.dat \/dev\/ttyUSB0 appendline '{TELEMETRY BATTERY=3.3V}'\r\nexiting...<\/pre>\n<h1>Usage:<\/h1>\n<h3>Server SIDE:<\/h3>\n<ul>\n<li><span style=\"line-height: 15px;\">Radiotftp can send and receive files <span style=\"text-decoration: underline;\">only<\/span> from the directory that it is running in. It is possible to try to use relative upper directories, but it&#8217;s not advised. Unpredictable things might happen. For the purposes of hosting I create a directory in my home folder called radiotftp_host<\/span><\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">mkdir -p ~\/radiotftp_host<\/pre>\n<ul>\n<li>Then cd into that directory and create a file called &#8216;<a title=\"Radiotftp.conf\" href=\"https:\/\/github.com\/alpsayin\/radiotftp\/blob\/master\/radiotftp.conf\" target=\"_blank\" rel=\"noopener\">radiotftp.conf<\/a>&#8216;. This file contains the hardware address (Amateur Call Sign) and your IPv4 address in two lines. An example is below. Note that this file needs a new line at the end of file to work properly.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">cd ~\/radiotftp_host\r\nnano radiotftp.conf<\/pre>\n<pre lang=\"text\" escaped=\"true\">TA2IAS4\r\n44.140.1.4<\/pre>\n<ul>\n<li>Then run the radiotftp server with suitable parameters. Since we are using radiotftp with Bim2A, we are going to invoke radiotftp with uhf parameter and assuming that your FTDI Usb Uart is mounted at \/dev\/ttyUSB0 we type in the command below. If you have more than 2 nodes in your network you should also specify a destination with -dst parameter or else the network is most likely to fail.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">radiotftp uhf \/dev\/ttyUSB0<\/pre>\n<pre lang=\"text\" escaped=\"true\">Running with UHF band 19200 baud version\r\nAX.25 Callsign: TA2IAS4\r\nUSING AX25 LINK LAYER!!!\r\nIPv4 Address: 44.140.1.4\r\nhello radio world!\r\nstarted listening...\r\ntransmit_length=130<\/pre>\n<ul>\n<li>If you can&#8217;t open the device, the most probable cause is that you dont have the right permissions for \/dev\/ttyUSB0. To set them right type in the command below. This command will give read+write access to every user.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">sudo chmod 666 \/dev\/ttyUSB0<\/pre>\n<ul>\n<li>Your radiotftp server is up and running, now we can now set the client. But before that, many users ask how to invoke radiotftp on the background during boot. Easiest practice is to add a few lines into \/etc\/rc.local to cd into your home directory and run radiotftp from there.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">cd ~\/radiotftp_host\r\nradiotftp uhf \/dev\/ttyUSB0 &amp;<\/pre>\n<ul>\n<li>Add the above lines to your rc.local file and during boot radiotftp should be started with root priveleges (no permission issues). Now, you are completely ready to set up the client.<\/li>\n<\/ul>\n<h3>Client SIDE:<\/h3>\n<ul>\n<li><span style=\"line-height: 15px;\">Client side setup is not so different than the server side. For good practice, I prefer creating a folder called radiotftp_client in my home directory.<\/span><\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">mkdir -p ~\/radiotftp_client<\/pre>\n<ul>\n<li>Like for the server side, you again need a &#8216;<a title=\"Radiotftp.conf\" href=\"https:\/\/github.com\/alpsayin\/radiotftp\/blob\/master\/radiotftp.conf\" target=\"_blank\" rel=\"noopener\">radiotftp.conf<\/a>&#8216; file for hardware address and IPv4 address setup. Again note that this file needs a new line at the end of the file to work properly.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">cd ~\/radiotftp_host\r\nnano radiotftp.conf<\/pre>\n<pre lang=\"text\" escaped=\"true\">TA2IAS15\r\n44.140.1.15<\/pre>\n<ul>\n<li>Again for good practice it is a good idea to test connectivity by running the radiotftp as server, on the client side. If there is a connection, the simple hello world protocol should help the server side to discover the client side. If the client side is discovered, you should see a new neighbour message in server side.<\/li>\n<\/ul>\n<pre lang=\"text\" escaped=\"true\">New neighbour:\r\nIP = 44.140.1.15<\/pre>\n<ul>\n<li>\u00a0To send a single file execute a command like below. If you don&#8217;t specify a destination address the software will automatically broadcast the requests. This works just fine if you have only 2 nodes. But if you have more than 2 nodes in your network you MUST specify a destination address or else the software will behave unstable, because logically it is irrational to make connection with broadcast IP.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">radiotftp uhf \/dev\/ttyUSB0 put localfile.txt<\/pre>\n<pre lang=\"bash\" escaped=\"true\">radiotftp uhf -dst44.140.1.4 \/dev\/ttyUSB0 put localfile.txt<\/pre>\n<p>Client Side Stdout:<\/p>\n<pre lang=\"text\" escaped=\"true\">Running with UHF band 19200 baud version\r\nAX.25 Callsign: TA2IAS15\r\nUSING AX25 LINK LAYER!!!\r\nIPv4 Address: 44.140.1.15\r\nput\r\ndestination = 255.255.255.255\r\nlocal-filename = ''\r\nremote-filename = 'alpsayin.txt' -&gt; 12\r\nfilename-check = 0x02\r\nempty local filename, copying remote filename\r\ntftp src port = 236\r\nremote_filename = 'alpsayin.txt'\r\nstarted listening...\r\ntransmit_length=156\r\ntftp wrq ack #0 received\r\nsent data size = 34\r\ntransmit_length=174\r\ntftp error received -&gt; TRANSMISSION COMPLETE: Closing in 10 seconds\r\nexiting...<\/pre>\n<p>Server Side Stdout:<\/p>\n<pre lang=\"text\" escaped=\"true\">filename: 'alpsayin.txt'\r\nmode: netascii\r\ncomment: \r\ntftp src port = 25313\r\ntftp WRQ connection received  12:37:23.433.952\r\nopening alpsayin.txt\r\nsent ack size = 4\r\ntransmit_length=114\r\nblock #1 length=34 written=30\r\nsize=34 -&gt; EOF\r\ntransmit_length=202\r\nconnection closed<\/pre>\n<ul>\n<li>Great! Now, you have sent your first file over a UHF radio link. During our development we used this link to send wireless sensor network data collected by a software called <a title=\"Sensd\" href=\"https:\/\/github.com\/herjulf\/sensd\" target=\"_blank\" rel=\"noopener\">sensd<\/a>. Sensd software is not off-the-shelf ready to be used with radiotftp so we forked it and modified it a little to buffer some messages and relay them to the radio link when the buffer is full. The modified <a title=\"Modified Sensd\" href=\"https:\/\/github.com\/alpsayin\/sensd.git\" target=\"_blank\" rel=\"noopener\">sensd<\/a> can be cloned from <a title=\"Modified Sensd\" href=\"https:\/\/github.com\/alpsayin\/sensd.git\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/li>\n<li>If you want to use the modified sensd with a KTH mote, you should clone sensd into your home directory and modify a few files after building it.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">cd ~\r\ngit clone https:\/\/github.com\/alpsayin\/sensd.git\r\ncd sensd\r\nmake\r\nsudo make install<\/pre>\n<ul>\n<li>Now you have sensd ready to be invoked from wherever you want. How you use sensd is up to you, it does original job of collecting wireless sensor network data wherever or however you invoke it. But to make it relay the collected data to radio, you must put a shell script called <a title=\"SendItAway.sh\" href=\"https:\/\/github.com\/alpsayin\/sensd\/blob\/master\/sendItAway.sh\" target=\"_blank\" rel=\"noopener\">sendItAway.sh<\/a> in the same directory you invoke it. For this purpose I recommend using the radiotftp_client directory that we created earlier. And then we can copy the example <a title=\"SendItAway.sh\" href=\"https:\/\/github.com\/alpsayin\/sensd\/blob\/master\/sendItAway.sh\" target=\"_blank\" rel=\"noopener\">sendItAway.sh<\/a> file<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">cd ~\/radiotftp_client\r\ncp ~\/sensd\/sendItAway.sh .\/\r\nnano sendItAway.sh<\/pre>\n<pre lang=\"bash\" escaped=\"true\" line=\"1\">#!\/bin\/sh                                                                                                 \r\nradiotftp uhf -fsensors.dat -dst255.255.255.255 \/dev\/ttyUSB2 appendline $@\r\n#echo $@ &gt;&gt; echo.txt<\/pre>\n<ul>\n<li>The only modifications you need to do is to change the destination address if you have more than 2 nodes, and setting the correct usb uart device as in the 4th parameter.<\/li>\n<li>After that you should invoke the sensd from this directory WITHOUT any file parameter, and all is set. If you type in a file parameter with &#8216;-f&#8217; option sensd will NOT relay the data to radio, but instead it will save it to that file.<\/li>\n<li>Finally, most users prefer invoking sensd in the boot, for this purpose you can add a few lines into the previously mentioned rc.local file in \/etc\/rc.local.<\/li>\n<\/ul>\n<pre lang=\"bash\" escaped=\"true\">sudo nano \/etc\/rc.local<\/pre>\n<pre lang=\"bash\" escaped=\"true\">cd ~\/radiotftp_client\r\nsensd &amp;<\/pre>\n<ul>\n<li>Now your client setup is complete. In the boot time, sensd will be started to collect data. And when its internal buffer is full, it will relay the buffered data by invoking radiotftp for a single time.<\/li>\n<\/ul>\n<h2>Finally; remember that there isn&#8217;t much documentation about this on the internet. So if you have a question, ask it below and I&#8217;ll try to answer. In such way we can build up a knowledge base.<\/h2>\n<h2><\/h2>\n","protected":false},"excerpt":{"rendered":"<p>You want a simple manual to jump into packet radio networking with radiotftp? You have the Radiometrix Bim2A devices ready at your hand with boards and everything? Just follow this guide thoroughly and you should have no problem. What you need for both sides: Any linux machine with a USB port and a Linux based [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":40,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ngg_post_thumbnail":0,"footnotes":""},"class_list":["post-15","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/alpsayin.com\/blog\/wp-json\/wp\/v2\/pages\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alpsayin.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/alpsayin.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/alpsayin.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alpsayin.com\/blog\/wp-json\/wp\/v2\/comments?post=15"}],"version-history":[{"count":3,"href":"https:\/\/alpsayin.com\/blog\/wp-json\/wp\/v2\/pages\/15\/revisions"}],"predecessor-version":[{"id":326,"href":"https:\/\/alpsayin.com\/blog\/wp-json\/wp\/v2\/pages\/15\/revisions\/326"}],"up":[{"embeddable":true,"href":"https:\/\/alpsayin.com\/blog\/wp-json\/wp\/v2\/pages\/40"}],"wp:attachment":[{"href":"https:\/\/alpsayin.com\/blog\/wp-json\/wp\/v2\/media?parent=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}