This post is more like a question...
This is always the same problem, most of the NMEA devices use a Serial Port, which is always accessed exclusively (i.e. by no more than one program at a given time).
The way around this exclusive access is to have the exclusive reader to rebroadcast the NMEA data using another channel, accessible from several other programs. This other channel can be HTTP, TCP, UDP... Those channels are machine, system and language agnostic. From Java to Java, RMI is also an interesting alternative.
SailMail reads the NMEA Stream to get the position of the boat, and thus is able to find the best SailMail station, provides the possibilty to rebroadcast the data it reads. Available channels are TCP, UDP, and even COM (rebroadcast on another serial port). It rebroadcasts the NMEA Sentence as it has been read, assuming - appropriately in my humble opinion - that if it is NMEA you are interested in, you know how to parse it.
There is also something else, which OpenCPN is aware of, this is GPSd.
It runs as a daemon - on the systems where daemons exist - and is only good for GPSs, not all the NMEA messages, because it's rebroadcasting the data after reworking them in another format, some proprietary classes over json (JavaScript Object Notation).
The GPSd protocol is not exactly documented, and the project leader does not return my emails...
In the NMEA Console, you can read any of those channels (Serial, TCP, UDP, RMI) and rebroadcast on HTTP, UDP, TCP and RMI (simultaneously if needed). I'm also working on a GPSd rebroadcast, running anywhere Java runs (no need for a daemon).
Anyway, both approaches have pros and cons (even if I'd rather rebroadcast the data as they come).
If anyone has any comment or idea, please speak up!
Thanks in advance.
Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts
Monday, June 25, 2012
Saturday, June 2, 2012
NMEA Stream re-broadcast
The NMEA Console (available at http://code.google.com/p/fullnmeaconsole/) is now fully aware of several communication channels, other than Serial port.
The data can be read from a Serial Port, UDP, or RMI. You can also replay NMEA Data, logged previously (the console has logging capabilities).
The data read from one of the channels above can be re-broadcasted on RMI, UDP, and XML over HTTP (there is a default html page displaying the data).
All the data are also cached in some HashMap, which means that any program living in the same JVM (or reaching it through RMI) can access them, without having to re-damp them (the damping factor is set at the "server" level, the one reading the data first). That is the case of all the modules coming with the console (Star Finder, Planetarium, Google Locator, etc).
If you have a wireless network (like Home Network) setup in the boat, then several machines can share the same data...
The next step would be to write a pugin for OpenCPN, so it can also re-broadcast the NMEA data... But that's another story, this is all in C++.
I also want to port the console (and more) on Android, to be able to display it on a table. The Tide application has been tested already, it's working good.
Keep posted, more to come!
The data read from one of the channels above can be re-broadcasted on RMI, UDP, and XML over HTTP (there is a default html page displaying the data).
All the data are also cached in some HashMap, which means that any program living in the same JVM (or reaching it through RMI) can access them, without having to re-damp them (the damping factor is set at the "server" level, the one reading the data first). That is the case of all the modules coming with the console (Star Finder, Planetarium, Google Locator, etc).
If you have a wireless network (like Home Network) setup in the boat, then several machines can share the same data...
The next step would be to write a pugin for OpenCPN, so it can also re-broadcast the NMEA data... But that's another story, this is all in C++.
I also want to port the console (and more) on Android, to be able to display it on a table. The Tide application has been tested already, it's working good.
Keep posted, more to come!
Friday, November 18, 2011
Java-Pactor Communication
I managed to establish the communication between Java code on the laptop and the SCS Pactor modem that is connected to the SSB, I've written a simple and basic character mode console that works on both Linux and Windows.
I will create a Google Code project, but in short, here are the parameters to set to the serial port:
I want to be able to read Navtex data, and receive faxes in the future. That would imply some signal processing (FFT and this kind of things). That sounds interesting...
Baud Rate: 57600 bpsNotice the RTS/CTS in, that remains unchecked.
Data bits: 8
Stop bits: 1
parity : none
RTS/CTS in [ ]
RTS/CTS out [x]
XON/XOFF in [ ]
XON/XOFF out [ ]
RTS : [x]
CTS : [ ]
DSR : [ ]
CD : [ ]
DTR : [x]
RI : [ ]
I want to be able to read Navtex data, and receive faxes in the future. That would imply some signal processing (FFT and this kind of things). That sounds interesting...
Wednesday, July 13, 2011
Tide computing
I had had that one in the back of my head for quite a while... a tide engine (in Java) you can plug anywhere.
Apparently, it did not exist. The closest I could find was JTides, which is good, but that does not provide this kind of feature outside of its own graphical user interface.
Well, now it exists, I wrote a utility to turn the tide data into two XML documents, so you can parse and use them. In java, that's a piece of cake. Surprisingly, the class that does all the job (water height or current speed at any moment) is less than 900 lines big; and it includes comments!
This will be soon published on Google Code, along with some samples.
But the cool thing is that it works as well as JTides does.
I'll post a new message when the code is available on Google.
Apparently, it did not exist. The closest I could find was JTides, which is good, but that does not provide this kind of feature outside of its own graphical user interface.
Well, now it exists, I wrote a utility to turn the tide data into two XML documents, so you can parse and use them. In java, that's a piece of cake. Surprisingly, the class that does all the job (water height or current speed at any moment) is less than 900 lines big; and it includes comments!
This will be soon published on Google Code, along with some samples.
But the cool thing is that it works as well as JTides does.
I'll post a new message when the code is available on Google.
Friday, February 27, 2009
User Exit

Rendering of faxes and GRIB data seems to be an endless topic..., the soft this blog is about provides some options, but there is way more to do.
That's why we came up with this user-exit feature, that allows anyone who knows a bit of Java to do whatever he wants, with the faxes - reworked or not (color and transparency) - and the GRIB data. This creates an entry in the popup menu of the chart panel, which you can select to trigger external code. The only restriction is to implement a given Java Interface, and you can access the context of the chart panel.
Above is an example of such a user-exit, smoothing and animating the GRIB data currently displayed in the chart pane. 500mb charts look a bit like a big slug drooling across the ocean...
We will soon post on the site a repository of such user exits (along with explanations about the way to write yours), the possibilities are endless.
The rendering provided by Processing is gorgious, I still need to look into it, for now I'm struggling with thread issues. They manage their own pool apparently, and I need to somehow sneak in... We'll see.
The video above is a preview of the animated GRIB slug. It's smaller than the real one, but the picture on top will give you an idea of the actual size.
Subscribe to:
Posts (Atom)