Jump to content
43oh

[POTM] dAISy - A Simple AIS Receiver


Recommended Posts

@chicken

Thank you so much for answering my questions.
I am really new in this field (embedded programming) but I have done couple programming tasks in Pascal and C/C++.

Just want to make things clear, 
So Debug_Messages and Test_Mode only works for CCS IDE?
If I remove 
#define Debug_Messages and #define Test_Mode, can your dAISy still run?

Link to post
Share on other sites
  • Replies 327
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Overview dAISy (do AIS yourself) is a very simple AIS receiver that I developed from scratch. It is built around the Silicon Labs EZRadioPRO Si4362 receiver, using a Texas Instruments MSP430G2553 MC

Ain't she pretty?    

Good news for everyone having difficulties sourcing the Si4362 radio IC.   I verified that the transceiver Si4463 works with dAISy. This probably also applies to Si4460 and Si4461. Besides being mor

Posted Images

Yes, you can remove both and it will still work.

#define TEST would enable extra code. I used that during development for testing the NMEA code without a radio. As long as the project does not define it, the test code will be skipped. It's not enabled in the code, so you don't have to worry about that.

#define DEBUG_MESSAGES is useful to get more information about the radio communication. I would leave that in until you got the receiver working, as it will help you tracking down what's going on.

 

Link to post
Share on other sites

thank you @chicken

i encountered a problem.
In PIC16f877a, the data bank memory only 96 byte.

but in your fifo.c, you set the fifo array buffer for 128 byte  and and 256 byte with fifo packet 8 byte.

I have looked for the AIS signal and it only consist of 256 bit or 32 byte. Is it possible to use PIC16f877a with only 96 byte to fifo buffer? thank you once again.

Link to post
Share on other sites

Hi @andimmike15

AIS messages can be longer than 32 bytes, for example message type 5 which includes the ship's name is 424 bits / 53 bytes.
http://catb.org/gpsd/AIVDM.html#_type_5_static_and_voyage_related_data

You could filter messages to only receive the position messages (types 1, 2, 3, 4, 9 and 18) by evaluating the message type at line 261 and resetting the packet handler state machine in case of an unwanted message.

Keep in mind, that while the received message is converted to NMEA0183, a new AIS message may start arriving. So allocate a few bytes more for the FIFO than the minimal message length (21 bytes for the above, so maybe make the FIFO 32 bytes long). Note that due to its current implementation, the FIFO length must be a power of two.

Setting FIFO_PACKETS to 2 is the minimum, again because a new packet may arrive while the first isn't fully processed yet.

Another big chunk of memory is in the NMEA encoding section. If filtering AIS messages, you can squeeze out a few bytes by limiting the maximum size of the NMEA payload to 21 bytes (nmea.c line 19), which translates to a NMEA output buffer of 43 bytes. You could shave of a few more bytes by not storing the AIVDM lead-in in the buffer but directly outputting it on serial.

Still, squeezing everything into into 96 bytes of RAM will be quite a challenge. The MSP430G2553 has a luxurious 512 bytes.

 

 

Link to post
Share on other sites

For all you AIS home-brewers out there: I've added the TAI-SAW TA0395A SAW filter to my Tindie store.

https://www.tindie.com/products/astuder/tai-saw-ta0395a-saw-filter/

This bandpass filter covers 6 MHz in the marine VHF band and can be found in many commercial AIS receiver and related equipment. As often with parts from specialist vendors, it is hard to come by without writing an RFQ and/or begging for samples. So I thought I'd sell some of my stash to fellow tinkerers.

Link to post
Share on other sites
  • 2 weeks later...

hello @chicken.

I have given up about using PIC. Now i move back to MSP430. But, there is some errors again. I didnt receive anything. I actually use my own AIS transponder. I live far away from ocean so I use my own transponder. 
I start to think if I can generate a dummy AIS signal through si4362 because I am not so sure where is the problem. Do you think it is possible to generate dummy AIS signal to si4362?

Link to post
Share on other sites

Hi @andimmike15

To debug the application, I'd go through the following steps:

1. Write something on the serial console to make sure that end works (uart_init, uart_send_string)

If that doesn't work, search this forum for tips on setting up serial output from your model of the LaunchPad.

2. Read the Si4362's part information and compare it to what's expected per datasheet (radio_setup, radio_part_info, radio_buffer.part_info.part_msb, radio_buffer.part_info.part_lsb)

If you don't get the expected values (e.g. 0x43 for the msb, 0x62 for the lsb if you're using an Si4362), then something with the SPI connections is wrong.

3. Toggle LEDs in strategic locations in the packet_handler ISR, to see whether raw data and clk bits from radio arrive at the MCU and the interrupt is invoked.

If that doesn't work, check that the correct radio and GPIO pins are connected.

If all the above works, then you're ready to worry about the actual AIS signal. That side is hard to simulate without an AIS target, but your transponder would be a good start. But be careful to not damage the Si4362 with a too strong signal. Directly connecting the transponder with the receiver will destroy the receiver.

Let me know if this helps, or where on that list you get stuck.

 

Link to post
Share on other sites
  • 1 month later...

Hi, I just got a dAISy 2 to test it, planning to use it to stream AIS data to a server, to setup an open API.

I’ve tried to open a UART connection both from usb than from AUX Serial port on the back.
I saw the led blinking indicating the dAISy is in receiving mode, but I’ve got no data on the serial.
The place where I’m now is quite far from the sea, so no surprise for now, but is there some way to test the connection, or should it print something anyway?
Like some keyword to transmit on the serial to retrive some configuration data at least?
 
thank you
 
 
Link to post
Share on other sites

Hi @pileoni

You can use a terminal program like Putty on Windows to connect to dAISy. Pressing ESC will bring up a debug/configuration menu. There, you can start a test mode by pressing T and then ENTER. dAISy will start outputting an AIS message every 5 seconds.
 
Alternatively, while in regular receive mode, you can send & to get dAISy to respond with its serial number.
 
Let me know if this helps.
 
Best Regards,
Adrian
 
Link to post
Share on other sites
  • 7 months later...

Really enjoy your diy approach to AIS solutions and products. I have a RPI 1 B but have failed to get opencpn or opencpn/openplotter to run so I probably need RPI 2 or 3 to get it going. However I find these tiny Linux PC's so slow booting they're not really practical. However I have worked a lot with Arduino(5v) & Esp8266(3.3v) and was wondering which AIS product of yours would you recommend for me to create a cost effective integrated standalone AIS solution ? 

Thanks

Ross

Link to post
Share on other sites

Hi Ross,

The best solution depends on what you want to achieve.

If you want to build a chartplotter, then OpenPlotter or a standalone setup of OpenCPN would be a viable approach. Both will require a RPI 3 as the GUI of OpenCPN ps

  • For OpenPlotter, I recommend the 1.0 image and not their latest alpha, unless you know what you're doing.
  • For standalone OpenCPN, this tutorial worked for me.

If you only want to track ships and may report to a website, then AISHub's rPiAIS is the quickest way to get up and running.

More DIY alternatives are Kplex (which OpenPlotter uses under the hood) or some form of home-brew Python script.

  • ais-forwarder to send received AIS messages over the network
  • simpleAIS to decode AIS messages in your Python project

You will find more AIS related projects under my Github stars.

Best Regards,
Adrian

 

Link to post
Share on other sites

PS: Forgot to answer the second part of your question.

All the variations of dAISy are suitable for something built around a Raspberry Pi. The HAT is the obvious fit, but the USB receivers work as well. The USB receivers have the added benefit, that you can also use them on a regular PC or laptop if you decide to move away from the Pi.

Link to post
Share on other sites

Thanks Adrian, it appears you lean towards a RPI solution but I was wondering if I could integrate your dAISy Hat board into an Arduino or esp8266 solution via 8/9-bit serial uart at 3.3/5v signal and power supply levels. So far I have developed parsers, mux, Rx/tx wifi for Nmea & seatalk on board instrument data and was wondering if I could also integrate AIS data using your AIS radio decoder ? Once all this data is centralised maybe I could use opencpn on a small touch screen with a Linux or Windows mini PC but that's down the road a bit.

Thanks

RossP

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...