Saturday, October 13, 2012

UDP Packet Logger

Last weekend, I made a handy little command line utility called "unlog" (Udp Network LOGger).  You can find the source here.  Once installed (and added to the path), just type unlog, if you want a timestamp or not, the port and then the file.  Then, unlog sits on that port and writes all of the UDP packets it gets to the file of your choice.  This might be handy for debugging UDP based ROV control applications or really just anything related UDP.



Sunday, October 7, 2012

[Tutorial] Bash Script for Arduino Uploader

Following the recent tutorial I wrote about flashing an Arduino hex file remotely using a Raspberry Pi, I wrote a bash script to automate the process.  To use this function, just copy the highlighted code to your .bash_profile or .bashrc file in your home directory.  With this function, you can just type arduinoupload path/to/my/file.hex in the command line and it will take care of the rest (assuming that you are trying to flash an Arduino Duemilanove using the "pi" user on the Raspberry Pi at IP AND that you have already setup an SSH public key between the two).  If you don't set up the SSH keys, you will be prompted to enter your password.  You can tweak the function to adjust it to your setup, or you can rewrite it to make it more flexible.  I chose to hardcode these values because my setup (IP, user, Arduino model) never changes.

This is just an interesting little bash script that somebody may be able to make use of.  If you want any explanations regarding the script, you can either ask me in the comments or use Google (I'm new to bash so it probably will be more helpful that I will be).

Thanks for stopping by!

Chris Konstad