Go Down

Topic: NMEA 2000 Shield (Read 206097 times) previous topic - next topic

timolappalainen

Definetely NGT-1 is not necessary. MCP2562 is CAN tranceiver and it is enough with boards with internal CAN controller like Teensy 3.2/3.5/3.5 or Arduino DUE. Also ESP32 has internal CAN controller, but I am just writing drivers for it, so it is not good choice yet.

If you connect  your device directly to the ST NG, make sure to connect right wires. Also be carfull with power, if you are going to use it. If you have your "Arduino" allways connected to PC, you can just use USB power and connect only CAN L/CAN H wires. If you are going to use bus power, you need to take care that you do not feed them against from bus and USB.

scottdube

ThanksTimo,

So if If I get the teensy do I still need the CAN transceiver?  It sounds like I do.  I saw your boards you made and it looks like you used both.  Initially I just want to listen to the STNG bus and redistribute the data, but I'm sure I'll want to end up putting data onto it at some point.  It will only be connected to a PC to troubleshoot. Thanks for your advice.  I appreciate it!

timolappalainen

You allways need tranceiver. Tranceiver is ready only on extension shied/breakout boards. If you are handy with electronics, you can use schematic for Teensy from https://github.com/ttlappalainen/NMEA2000/tree/master/Examples/TeensyActisenseListenerSender/Documents and make board simply by yourself. This has extra USB, which you do not need.

Other option is to buy ready board http://skpang.co.uk/catalog/teensy-canbus-breakout-board-include-teensy-32-p-1507.html. That uses linear DC-DC converter instead of scwithed one as I have on my schematics. As far as I see you should not power that breakout at same time from bus or USB. On my above docs there is also instructions how to separate USB power.

Other options are bigger on size and draws more current.

scottdube

#438
Apr 06, 2018, 01:46 pm Last Edit: Apr 06, 2018, 02:05 pm by scottdube
Timo,

Is there a place where all of the libraries required to run this on teensy 3.2 reside?  I followed your instructions in the nmea 2000 reference but there are libraries missing on compile.  I don't want to just go find those individually as I'm afraid of finding out of date files.

Thanks!

UPDATE:  I think I got it...  It mostly compiles but since I don't have my board yet it appears it won't complete the compile.  I am used to being able to compile without a board attached but it looks like it doesn't work like that for this board.  I will know better when my board arrives.

Thanks!

timolappalainen

For Teensy NMEA2000 you need:
- Teensyduino installed.
- https://github.com/ttlappalainen/NMEA2000
- https://github.com/ttlappalainen/FlexCAN_Library
- https://github.com/ttlappalainen/NMEA2000_teensy

Note that on Teensyduino install you should not install FlexCAN. If you did, delete folder:
"C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FlexCAN"

It should complete compilation without board and there should not be any errors/warning, if you use just compile button at leftmost on Arduino IDE.

scottdube

You were right, I loaded flexcan when I added Teensyduino.  I'm on a Mac so it took me a while to find but I got rid of the flexcan library in that install and it compiles just fine!  Now to try to get the simulator running!

Thanks again!

timolappalainen

Hi all, I just added ESP32 support to NMEA2000 library.

popeye_70

Hi Timo,
i have a question about Nmea2000 rules: can i have two devices sending the 127489 PGN (but different fields) at same time?
For example, a device that sends field #11 discrete status 1 data, while another device is sending oil press and water temp?

timolappalainen

Yes you can. Take care that you provide "Not available" data to all fields you do not send on each PGN.

Also take care that you set different unique number for your devices. If you use my library, you define it during setup with NMEA2000.SetDeviceInformation(...). It is also best to set ProductInformation right, so you can separate the devices on MFD devicelist.

scottdube

Is there a place to get the N2K connectors?  I thought I saw it in this thread but I went trhough all 30 pages and did not find it!

Thanks

Scott

timolappalainen

I do not know, what happened my previous reply.

For boards and hubs I have used 5 pos terminal blocks. Below are example Farnell codes:
- 1717013 CTB9208/5 TERMINAL BLOCK, PLUGGABLE, 5POS
- 1717025 CTB9308/5 TERMINAL BLOCK, HEADER, 5POS

Standard 5 pos Micro-C M12 connectors can be found e.g. from tme.eu. Look on
Connectors-Industrial Connectors-Industrial circular connectors-M12 connectors Filter "Number of Pins" to 5 and "Polarization" to "A code - DeviceNet" to get a list of possible NMEA2000 connectors. I used e.g.
- ELWIKA5012PG9 Connector:M12;female;PIN:5;angled 90°
- 12P-05PFFS-SF8001 Connector:M12;female;PIN:5
- 12P-05BMMA-SL8001 Connector:M12;male;PIN:5
- 12P-05BFFA-SL8001 Connector:M12;female;PIN:5

scottdube

Thanks Timo,

I'm sure I saw that post but I could not find it again!  BTW I got the NMEA Simulator working on my Mac last night and can't wait to try it on the boat.  Should get a teensy board and 2562 delivered today!

Thanks!

scottdube

So Timo,

Got the teensy running and communicating with the computer, had some challenges as I have a VM running on my mac which is my windows machine.  If anyone has trouble I can share what I needed to do. 

I have the TemperatureMonitor.ino running and it is visible to the Actisence NMEA Reader software.  I do not get the 4 PGNs that you reference in your documents though.

"Now you should see "ISO address claim" (PGN 60928), "Environmental parameters" (PGN 130310) ), "Environmental parameters" (PGN 130311) and "Temperature" (PGN 130312) messages on "NMEA Reader"."

I get all but the 60928 pgn.  I do however get 126993 which is the "heartbeat" I guess.

Any thoughts? 

Also, I am thinking the first stage of this will be as a listener, I just want to make sure I have this right.  I will connect the N2K bus L&H via the CAN BUS that I'm going to build.  If I later want the device to broadcast to the N2K bus do I really need the serial to USB converter you show?  I don't want to then create another physical conversion back to the N2K bus.  But can I connect the TX and RX to the same L&H wires?

Thanks!!!

timolappalainen

Ypu probably won't see 60928, since that will be send on the very beginning and the USB is not ready for communication, so NMEA Reader will miss it. If you would have it connected to real bus, some device would probably reaquest it and you would see it and some others then.

What do you mean with "...serial to USB converter you show"?

scottdube

What do you mean with "...serial to USB converter you show"?

I mean in the schematic and jpg that you have on teensy listener sender it shows 2 USB plugs.

https://github.com/ttlappalainen/NMEA2000/blob/master/Examples/TeensyActisenseListenerSender/Documents/Teensy_Actisense_listener_sender.pdf

 I'm not sure where you were plugging those into.  Unless one is for power or computer.  But my goal is for this box to send the data to another location without a pc in the middle.

Does that make sense?

Thanks you are a great person to help people like this!

Scott

Go Up