Showing posts with label aprx. Show all posts
Showing posts with label aprx. Show all posts

Sunday, 20 November 2016

Displaying aprx-rf log onto 4x20 LCD display

Received a request on a short how-to to get the aprs packet shown in the 20x4 LCD display. The way I have for my setup are the following:

1. Raspberry Pi 3 (Raspberry Pi 2 will work, but below that, you need to have different kind of connection for the GPIO).
2. 20x4 LCD HD44780 or compatible screen.
3. Install lcdproc package ($ sudo apt-get install lcdproc)
4. A modified HD44780 driver,

I'm using the following diagram for my LCD connection to the GPIO lines. Ignore the temp sensor connection.

*Connection diagram taken from rototron.info website.

The how-to to get the LCD working can be found on the http://www.rototron.info/lcdproc-tutorial-for-raspberry-pi/ too.

A modified HD44780 driver can be found down below along with my python code.

Or download or compile your own following the thread in the following forum link:

https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=100066

This modified driver need to be moved into /usr/lib/arm-linux-gnueabihf/lcdproc/ directory and replacing the driver that comes with the lcdproc package.

Add the correct configuration (if missing) from your /etc/LCDd.conf. I've the following:

[server]
DriverPath=/usr/lib/arm-linux-gnueabihf/lcdproc/
NextScreenKey=Right
PrevScreenKey=Left
ReportToSyslog=yes
ToggleRotateKey=Enter
Driver=hd44780
ServerScreen=no


[hd44780]
ConnectionType=raspberrypi
Size=20x4

Done with the above, you can test your LCD setup if it is working correctly, run the LCD and lcdproc daemon:

$ sudo /etc/init.d/LCDd start
$ sudo /etc/init.d/lcdproc start

The above should bring up your LCD alive and show the cpu information etc if everything set correctly. You can enable or disable what to be displayed in configuration file /etc/lcdproc.conf. For me, I've disabled most of them except the cpu information.

Now, you've got the LCD working. Great, now the fun part to code a simple python script so that it will read the aprx log file and display the last line into the LCD screen. You need at least a Python 2.7 which I believe should be installed as default. You also need few more packages, namely the aprslib (to parse APRS packets), lcdproc (for displaying to LCD) and LatLon (for calculating distance).

To install the lastest aprslib python package, please refer to the following website:

https://pypi.python.org/pypi/aprslib

To install the latest lcdproc package, you can refer to the official website:

https://github.com/jinglemansweep/lcdproc

And lastly the LatLon package can be found here:

https://pypi.python.org/pypi/LatLon/1.0.2

My lovely looking python coding, modified driver and startup script to get everything to appear on LCD screen can be found here:

https://drive.google.com/open?id=0B_kYO6BlPebVdjR4QUJuVkM2dG8

To run the above python code, just run it against the aprx-rf.log, example:

$python aprx_lcd.py /var/log/aprx-rf.log

I have it running as a daemon by creating a startup script in /etc/init.d/. Sample can be found in the above file in my google drive.

Have fun!







Thursday, 1 September 2016

TNC-Pi 2 + Raspberry Pi 2 + LCDProc

It has been a while my igate was down because of lightning strike and I have never got a chance to bring it alive again. It was few months back when I was bored and ordered a couple of TNC-Pi 2 from tnc-x.com. The kits arrived a couple of week later and had it assembled them in no time (the first kit was up and running on the same day I received the kits).


The first kit during assembly period (pardon my soldering skill):




The first kit done:


In operation, couldn't find a good case to put them in, so for now, this is the best I could do :)


Software wise, I'm running the latest Debian Jessie on Raspi 2, with the latest aprx, lcdproc and weewx. I've wrote a simple python code to read the aprs-rf.log file and pass it over to lcdproc to display it on a 20x4 LCD. This LCD is from my previous project that has been abandoned. Everything seems to work great so far.

My first python code (pardon the coding style), can be found here.
https://drive.google.com/open?id=0B_kYO6BlPebVcldWTVdoaS13OVE

Saturday, 19 September 2015

Getting your WX station out to RF using weewx + aprx

I have been using my WH1080 since two years ago and it is still working great until few days ago when I found out that the anemometer doesn't seem to give any reading anymore. Anyway, other than that, everything still working just fine.

I have been experimenting with Raspberry Pi for quite sometime and I've moved my WX and aprx along with few local server apps into Raspberry Pi (previously on my router running OpenWRT). Anyway, for this post, I'm going to guide you on how to get the WX data into RF without a need of the Internet connection after the first setup.

What needed?

1. Raspberry Pi, I'm using raspbian. I'm not going in details on how to set it up. By now you should've been able to get this up and running.
2. weewx software, more information can be found in http://www.weewx.com/. Installation guide can be found here: http://www.weewx.com/docs/debian.htm
3. A weewx extension that I've adopted from cwxn extension so it could produce an aprx ready beacon file can be found here: weewx2aprx-0.4.zip (old deprecated package ->) weewx2aprx-0.1.tgz
4. Aprx package which can be found here (prepackaged): http://thelifeofkenneth.com/aprx/debs/

After you've got everything installed, the weewx and aprx package. You can install the weewx2aprx extension, to do this, just use the following command:

wee_extension --install weewx2aprx-0.1.tgz

          wee_extension --install weewx2aprx-0.4.zip   


You need to edit the /etc/weewx/weewx.conf. Toward the end of the configuration file, there is a new section created by the above extension installer. Edit as required, the necessary fields are the lat, lon and the note.

# Options for extension 'aprx'
[Weewx2APRX]
    lat = 0312.81N
    note = "WH1080+weewx+aprx Sg Buloh, Malaysia"
    symbol = /_
    lon = 10133.17E
    filename = /var/tmp/aprx_wx.txt 
Change the above to suite your preference and rerun the weewx's service by issuing the following commands:

$ sudo /etc/init.d/weewx stop 
$ sudo /etc/init.d/weewx start 


Edit your /etc/aprx.conf file and add the following information under the beacon, change the callsign as necessary :

        beaconmode radio
        beacon srccall 9M2TPT-13 \                                             
              via WIDE1-1,WIDE2-2 \                                            
              file /var/tmp/aprx_wx.txt

 That should be it.

 Tips and tricks working with Form templates in S4 Public Cloud: Downloading XML In SD and some MM outputs, you could change the print queue...