NMEA 2000 Shield

With the same connection I can read depth sounder info from the bus so the connection could be ok. Also that two channel test shows the connection should be ok. Could it be that GNX 20 is "refusing" to communicate with non genuine NMEA 2000 device? Would it be interesting to know if the other arduino with actisense listener sketch is reading what the other with temperature monitor is sending? Would two arduinos one sending and one recieving see each other as devices on the bus?

N2k bus devices does not normally care who is sending data. They can show e.g. speed data even knowing anything about sender device. This of coarse may denpend of MFD, but e.g. my Garmin GMI 20 does not care. It just shows on devices "unknown device"

Two Arduinos communicate also well. There are examples MessageSender and DataDisplay2, which I have used to test different messages. They does not act as like normal N2k bus device. TemperatureMonitor is the most closes of certified device. So by connecting two TemperatureMonitor to the bus, they do all handshaking and sees each other, but since they are just sending data, they does not listen each other messages. If you change mode to N2k_ListenAndNode and enable message forwarding, then they will forward others messages.

I have to do some more tests. If you have some device sending on bus, then everything works fine, when you connect device. If I start due first and then connect my MFD, it start to work right. If I have due and then connect other TemperatureMonitor, it may get totally blocked.

So you could try cnnecting your MFD, depth sounder and due to the bus and then start due.

I was testing Wind Monitor with eco and display last autumn but no wind info showed up on the display. It was then when I was able to read depth from the bus. Now depth sounder is at the boat and arduino and display are at home. When testing two arduinos in the bus should they be connected with separate T-connections or is it ok to connect them at the same branch? Can the send failed caused by failing hand shake? I will test two arduinos this weekend. The other could be loaded with TemperatureMonitor but which sketch to load to the other?

For test bed it is enough to connect CAN-L/CAN-H with wires. I personally do not use M12 connectors at all, since they require so much space. Instead I use pluggable board connectors (see e.g. farnell codes 1717013 and 1717025 Connector order is shown on my drawing https://github.com/ttlappalainen/NMEA2000/blob/master/Examples/TeensyActisenseListenerSender/Documents/Teensy_Actisense_listener_sender_schematics.pdf). With those you can make CAN bus divider for 5 connectors to 100x55x40 mm box with about 20 €.

Due should work with just display connected. You could also use ActisenseListener example on due and when you turn on display, it should send ISO Address (PGN 60928) claim at the beginning. It is strange, if you do not receive anything from display.

There is actually no handshaking betwee N2k devices. They just do address claiming, which means they ask "I would like to use address 20". If other devices on the bus are happy for that, thats it. If there is other device using address 20, it compares its "name" to other and then either responces "I have address 20" or "I would like to use address 21" depending of priority of "name". All this will be done just using ISO address claim PGN.

The block I caused on my test was because of having two TemperatureMonitor with same "name" on the bus. This should never happen, since as I have documented for SetDeviceInformation: "Each device from same manufacturer should have unique number.". So if you have two TemperatureMonitor, you have to compile one with e.g. Unique number=112233 and other with Unique number=112234

Played with two dues and display connected as a bus. Both dues can see display info trough actisense listener as it is turned on. When the other due has Temperature monitor loaded it can't be seen on the other board with actisense listener. Also send failed appears after a while as previously.

Unfortunately I can not produce that. I have only one due, so I can not test with two dues. But with due/TemperatureMonitor and Teensy/ActisenseListener it works fine. If I disconnect Teensy, "Send failed" appears, but immediately after powering it on, also due starts to send.

To exclude software problem is it possible to download program to due from a file instead of first compiling it from sketch and libraries on my own computer? If so then both problems with libraries and Arduino programming IDE on my computer would be excluded. Other way around would be to test my hardware with known working environment. I think I have the correct due can and NMEA 2000 due as if I remove either of them compiling fails and when I download them from your repository compiling is successful. Could there be a problem in the IDE on my computer? I have two different CAN transceivers and they both receive but neither of them send with this software. Anyhow I have tested them both with a test program behind this link and it says they are ok: http://copperhilltech.com/content/Due_2CAN_Channel_Test.zip After testing i have removed all of that CAN stuff from my computer.

I have IDE 1.83, I do not believe that is the problem. Could you recheck STBY pin on MCP2562! In Coppertechhill code there is code:

cRetCode = Can0.begin(lBaudrate, ENABLE_PIN_CAN0);


define ENABLE_PIN_CAN0 62

In my examples there is no enable pin used and STBY has been expected to be connected to GND. Start e.g. TemperatureMonitor and measure with voltmeter that STBY has 0 voltage.

The IDE on my computer is the same then. Pins 2 and 8 are connected to ground on MCP2562. If i solder another MCP2562 with connections for due and mail it to you after having tested what it does would you test it yourself? You would not have to return it.

Hi Timo and all.

I’m new here and for starters I’d like to say thanks to all of you for contributing tons of useful information on this topic. In fact, the info is so much it is overwhelming, for me being a newbie anyway.

Since this topic was started lots have changed with regards to new hardware available and changes to sketches as well, where to start.

I guess keeping it simple is the way to go for starters.

Basically I need some guidance as to what direction to go in in order to inject IMU heading data into my fishing boat NMEA2000 network.

I don’t have any hardware yet so this is a fresh start, I’d like to keep it as cheap, small, simple and the least power consuming as possible. (with “No Hardware” I’m not referring to my boat equipment, I mean no MicroPrcessor Unit, CanBus Shield, Serial Converters etc.)

At a later stage I’d like to further my knowledge with NMEA0183 <-> NMEA2000 data sharing and monitoring.

Some direction and opinions would be much appreciated.

Thanks guys.

Heikkif - yes, I can test it.

As I have many times mentioned on this list I prefer at least Teensy 3.2. It draws only 90 mA current.

But before goint to hw, it is best to have some kind of idea about the goal. Either you did not mention what your IMU sends.

timolappalainen: As I have many times mentioned on this list I prefer at least Teensy 3.2. It draws only 90 mA current.

But before goint to hw, it is best to have some kind of idea about the goal. Either you did not mention what your IMU sends.

Haven't bought any components yet, I was hoping for good recommendations before I go out and spend money.

Yes, but I can not give any recommendations, if you do not define any goal. And what about IMU - do you have any? Do you have or have you planned to buy some MFD? What sensors you would like to have? Did you thought to use PC, phone tablet? Etc.

I was thinking of using the SparkFun 9DoF Razor IMU, can it be combined with your Teeny 3.2 setup in order to inject heading data to NMEA2000 network?

I would probably use my PC for starters to set everything up and monitor for correct operation, thereafter it should be externally powered and run as a standalone system as to have a stable heading on my Lowrance Elite 7Ti unit.

One company has started to make Teensy based sensor boards for NMEA2000. They contacted me due to my library and send me some sample boards. There is one nice ready IMU board. I can ask are they ready to sell.

On the other hand I have tested different IMU:s and none of then can not beat my GPS compass, which gives reliable 1 deg heading in any condition and boat tilt. You can get reasonable GPS compass in about 1000 € or spent 50-100 hours with IMU:s.

timolappalainen: One company has started to make Teensy based sensor boards for NMEA2000. They contacted me due to my library and send me some sample boards. There is one nice ready IMU board. I can ask are they ready to sell.

I'd be interested thanks

timolappalainen: You can get reasonable GPS compass in about 1000 € or spent 50-100 hours with IMU:s.

Lowrance Point 1 GPS/Heading antenna €280, but that defeats the object of accomplishing the task myself as a project.

Thanks for your input.

Hi Johannes and Timo,

A bit offtopic maybe. I have been building compass also. It works but accuracy is not within 1 deg more like 3 degs. Self made compass might be feasible to control tiller pilot as gyro and heel data is also available from IMU. I am using DUE for this as it was the first thing I bought for another purpose. Sparkfun has currently 3 products for this purpose. There are other sources also. For MPU 9250 there is no library from Sparkfun that would run on DUE. Haven't found elsewhere either. I am using LSM9DS1 which I can read to DUE. Otherwise ok but magnetometer needs temperature compensation and that I had to program on Arduino. I haven't found out how sensors own temperature compensation works. The sensor has temperature output but it looks like the resolution is a bit coarse compared to the slope of compensation needed. That limits the accuracy. LSM9DS1 means lot of calibration and each sensor needs its own calibration so if one needs to replace the sensor the calibration has to be done again. Third one on Sparkfun would be that razor Johannes mentioned. It uses MPU 9250. It is not clear to me if the libraries can be loaded to for example teensy as well. If so then why not to use MPU 9250 and some board that is easily CAN-compatible. MPU 9250 should have factory calibration data stored in it. I do not know if the sketches can use it. People mention good calibration is needed with MPU 9250 also. Some links worth checking:

http://sailboatinstruments.blogspot.fi/2014/08/a-low-cost-marine-compass-part-3.html http://sailboatinstruments.blogspot.fi/2016/04/building-your-own-nmea-2000-device.html (this made me buy DUE when I found out Garmin GNX 20 does not have shallow water alarm) http://www.pypilot.org/ https://github.com/seandepagnier/RTIMULib2 https://github.com/kriswiner/MPU9250 https://create.arduino.cc/projecthub/mitov/arduino-accelerometer-gyroscope-compass-mpu9250-i2c-sensor-79f5bf

Thanks Heikkif, I'll look at your links and see what I can find useful.

I see the Genuino 101 has onboard IMU, wonder if this is worth looking at and if it would be compatible with the Tweeny 3.2 setup to get IMU data onto the Can Bus network?

"I see the Genuino 101 has onboard IMU" It has gyro and accel but for compass magnetometer is also needed.