Go Down

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

peterwholm

Timo - you should be a teacher :-) Thank you!
I went through my wiring, and I can see that my backbone is actually going up through the mast. The height (above waterline) is 17 meters which is a bit more than a dropcable can cope ;-)


I tried to hook up my Teensy 3.2 with SN65HVD230 and load the "TemperatureMonitor" sketch. But I wasn't able to read the (fictive) temperatures on my  GMI 20 MFD :-(

I just connected jumperwires into the socket of a female NMEA 2000 cable, so perhaps the problem was a combination of noise, poor connection and... (?)

But nevertheless I have just received the ISO1050 transciever, capacitors (0,1 and 0,33 uF)  and will solder the parts together the coming weekend. 
But during my research of the ISO1050 IC I stumbled upon the following link:
https://e2e.ti.com/support/isolation/f/1013/t/648050

Did any of you use a pullup resistor between the Teensy TX and ISO1050 TX and +3,3V? 
I can't really figure out if the sketch calls for the Teensy 3.2 pullup resistor, or if its enough to avoid the TX output to "float"?

skyjumper

I went through my wiring, and I can see that my backbone is actually going up through the mast. The height (above waterline) is 17 meters which is a bit more than a dropcable can cope ;-)
Just curious, what N2K device do you have at the top of your mast?

timolappalainen

Normally there is some kind of weather station on the mast. E.g. Airmar stations uses N2k, but at least some B&G stations has NMEA0813 cable down and small converter box for connection to N2k. The cable looks very similar, which is confusing for users. So it is important to check what kind of data actually goes to the top to know where you need to have termination. Also I found that one weather station had termination resistor build in, which you could not even remove.

Note that the schematics has 120 ohm termination, which you do not use, if your device is not at end of backbone.

I have not used pull up resistor, but 10k will not make any harm.

peterwholm

Just curious, what N2K device do you have at the top of your mast?
The boat is ashore with mast, so I am actually not 100% sure. But I have a Garmin GMI 20 and DST800, and I know it was sold as a bundle together with the GWS 10 wind transducer. 


So I assume it's a GWS 10, but I can't  tell for sure. 

timolappalainen

According manual https://static.garmin.com/pumac/GWS_10_Install_ML.pdf GWS10 has NMEA2000 all the way to the top.

Libera-8

Hello Timo,
I use DUE with Librarys due_can, NMEA2000_due and NMEA2000.
I changed all three Librarys (01.03.2021) and now I have an issue with PGN127489, Engine parameters dynamic.
With the current Librarys I get 8 Warning Flags on my Ray Axiom Display: EngineUnknownError1 - 7.
All values and the 24 Status Flags of the PGN work fine, so I think, there must be 8 flags too much in the new version.
Do you have an Idea?
If you need more information, please dont hesitate to ask me.
Thanks a lot for your work,
Manfred

timolappalainen

Sorry my mistake. It is this good N2k logic that normally all reserved data should set to 1 except with status bits. There is update, please test with that.

Libera-8

Thank you so much!
Its working again!!!!  :)

I have always a bottle of good red wine here for you if you visit me!

Libera-8

Hey Timo,
one more question:
I have two sources for COGSOGRapid, PGN129026, in my Network. I am not able, to switch this PGN off on my HDS Gen. 3.

How can I choose one of these two sources?
Your Library parses SID, HeadingReference, COG, SOG. There is no feature to choose the message sender.


timolappalainen

#1059
Mar 06, 2021, 12:35 pm Last Edit: Mar 06, 2021, 12:36 pm by timolappalainen
N2kMsg.Source gives you sender address.

But life is not that easy. It works on your boat as soon as your HDS does not change address. To make it water proof you have to use N2kDeviceList module.

Code: [Select]
tN2kDeviceList N2kDeviceList(&NMEA2000);



Then you glue the device you want to listen with its NAME

Code: [Select]
uint64_t COGSOGDeviceNAME=...
uint8_t COGSOGDeviceSource=0xff;



and periodically call

Code: [Select]
if ( N2kDeviceList.ReadResetIsListUpdated() ) {
 const tNMEA2000::tDevice *COGSOGDevice=N2kDeviceList.FindDeviceByName(COGSOGDeviceNAME);
 if ( COGSOGDevice!=0 ) { COGSOGDeviceSource=COGSOGDevice.GetName(); }
}



Now you can filter messages on your handler:

Code: [Select]
if ( N2kMsg.Source==COGSOGDeviceSource ) {...


Note that if you dot know the full NAME you can also search devices with
- FindDeviceByIDs(uint16_t ManufacturerCode, uint32_t UniqueNumber)
- FindDeviceByProduct(uint16_t ManufacturerCode, uint16_t ProductCode, uint8_t Source=0xff)

Libera-8

OK, Timo, that is hard stuff for specialists lke you. :-)
At least, i can see the adresses of all units in my Axiom Display and I can filter then the message with N2kMsg.Source.

But - is there no message to tell a device, it should not send a message?
I think, there is, maybe proprietary, because, if there 5 Displays in the net, only one should send rapid position.
If I choose in my Axiom Display the AIS unit as Source for position, it stops sending position data by itself.
And absolutly grazy, my HDS is configured also to use AIS unit as position source, and is still sending this data as rapid position into the net. So I have rapid Position from AIS unit doubled in the net. I can not understand this stupidity.


timolappalainen

There is Request group function 126208, which can be used to command interval to 0, which means to stop transmission. But this is optional and devices does not need to follow command. I tested it with some device and it changed interval, but I did not test does it stop sending.

Libera-8

Hey Timo,
please one more your help:
I want to
- send a waypoint
- receive a waypoint
Sending I do as following: (It works on my Plotter, hope it is correct)
Code: [Select]

   if (bSend == true)  {   
      bSend = false;
      tN2kMsg N2kMsg;
      char Name [] = "Anker";

      SetN2kPGN130074(N2kMsg, 1, 1, 1);
      AppendN2kPGN130074(N2kMsg,  1, Name, Latitude_Anker_d,  Longitude_Anker_d);
      NMEA2000.SendMsg(N2kMsg);
   }


But reading a Waypoint, I dont know what to do.
I tried as following: (error binding 'const tN2kMsg' to reference of type 'tN2kMsg&' discards qualifiers)
Code: [Select]

void WaypointList(const tN2kMsg &N2kMsg) {
 
   uint16_t Start;               // The ID of the first waypoint
   uint16_t NumWaypoints;        // Number of valid WPs in the WP-List
   uint16_t Database;            // Database ID

   uint16_t ID;                  // The ID of the current waypoint
   char* Name;                   // The name of the current waypoint
   double Latitude;              // The latitude of the current waypoint 
   double Longitude;             // The longitude of the current waypoint 

   if (AppendN2kPGN130074(N2kMsg,ID[],Name[],Latitude[],Longitude[])) {
      Serial.println (Name);
      Serial.println (Latitude);
   }
}


and this: (error 'ParseN2kPGN130074' was not declared in this scope)

Code: [Select]

void WaypointList(const tN2kMsg &N2kMsg) {
 
   uint16_t Start;               // The ID of the first waypoint
   uint16_t NumWaypoints;        // Number of valid WPs in the WP-List
   uint16_t Database;            // Database ID

   uint16_t ID;                  // The ID of the current waypoint
   char* Name;                   // The name of the current waypoint
   double Latitude;              // The latitude of the current waypoint 
   double Longitude;             // The longitude of the current waypoint 



   if (ParseN2kPGN130074(N2kMsg,ID,Name,Latitude,Longitude)) {
      Serial.println (Name);
      Serial.println (Latitude);
   }
}




timolappalainen

Your basics are wrong.

Code: [Select]
if (AppendN2kPGN130074(N2kMsg,ID[],Name[],Latitude[],Longitude[])) {



E.g. ID[] does not mean anything. It is like a vector, but can be used in definition, where give initial value. E.g.

Code: [Select]
const uint8_t IDs[]={1,2,4,7,9};

If you want to give vector as parameter, you then just point IDs or specific value on vector IDs[2].

The next problem is that there is no parser for 130074 published.

Libera-8

Yes, I understand. But not your last sentence. Without parser I cannot receive Waypoints?

Go Up