I’m writing code for machine control (sprayer section control) without AutoSteer. It is working well in simulator. Now I want to implement a physical Work switch to control painting.
What PGN do I use to to update AOG of the switch status?
I’m writing code for machine control (sprayer section control) without AutoSteer. It is working well in simulator. Now I want to implement a physical Work switch to control painting.
What PGN do I use to to update AOG of the switch status?
PGN 0x7FFD found in
Even though the docs are wrong and say 0x7EFD
Thanks for the reply.
From PGN.MD the PGN 0x7EFD is listed as “From Autosteer” with its dataLoad as
Byte 5& Byte6 ActualSteerAngle * 100
Byte 7& Byte8 IMU Heading Hi/Lo
Byte 9&Byte10 IMU RollHi/Lo
Byte 11 Switch
Byte 12 PWMDisplay
I take it that I can send this rather than receive it, and the SWITCH is the work switch (1 On, 0 Off)?
Since I’m not using data from bytes other than 11, what should I fill those bytes with?
0
On byte 11,
0 = all off
1 = autosteer on
2 = work on
3 = autosteer and work on
I appreciate all help, however so far no success on using code to to control Work/Steer switch status.
-------------------------Function sending PGN253 packet -----------------------------------
void sendPgn253() {
if(debug253){Serial.printf(“Inside sendPgn253\n”);}
uint8_t udpPkt[5+8+1] = { 0x80, 0x81, 0x7E, 0x7D, 0x08, /*byte 0-4 hdr, hdr, Src, PGN, Len, */
0x00, 0x00, 0x00, 0x00, /*byte 5-8 */
0x00, 0x00, 0x02, 0x00, /*byte 9, 10, 11, 12–for 11 (0=all off, 1=autosteer on, 2 = work on, 3= both on) */
0x00 }; /*CRC 13 */
udpPkt[13] = chk(udpPkt, sizeof(udpPkt));
udpSend(udpNmea, udpPkt, sizeof(udpPkt), bcIP, PORT_NMEA);
last253=millis();
}
---------------- To be sure I understand what I’m trying to do --------------------------------
Correction
When sending PGN 7E FD (7E 253) the UDP Monitor does see it
But it does not change on screen icon.
Maybe you must send to correct CRC.
Also there is a PGN234 somewhere (not documented apparently) to specifically control the sections states.
Check this one
EA is the one I think.
OK. It seems be be working now.
Using PGN 7F EA, (32746), or 7F 234
Byte0 of Data Load, values used, (0x01 = Work Switch On) (0x02 = Work Switch Off)
FROM–> PGN 234: Section Status Feedback
Direction : ESP32 → AgOpenGPS Purpose: Reports the actual status of sections (manual overrides, master switch) Rate: 100ms (10 Hz)
Packet Structure
0x80 0x81 0x7F 0xEA 0x08 [8 bytes of data] [CHK]
└─┬──┘ └─┬──┘ └┬┘
│ │ │
PGN 234 │ Length
│
Data Length = 8
Data Payload (8 bytes)
| Byte | Field | Description |
|---|---|---|
| 0 | Status | Module presence and master switch status |
| 1 | Auto mask for sections 1-8 | Sections in AUTO mode (available for AgOpenGPS control) |
| 2 | Auto mask for sections 9-16 | Extended AUTO mask for additional sections (0x00 for 4-section setup) |
| 3 | Section Count | Number of sections (4) |
| 4 | Force-ON mask 1-8 | Sections forced ON regardless of AOG command (rarely used, typically 0x00) |
| 5 | Force-OFF mask 1-8 | Sections manually forced OFF |
| 6 | Force-ON mask 9-16 | Extended force-ON for additional sections (0x00 for 4-section setup) |
| 7 | Force-OFF mask 9-16 | Extended force-OFF for additional sections (0x00 for 4-section setup) |
Note : Bytes 2, 4, 6, and 7 support systems with more than 8 sections and force-ON functionality. For typical 4-section implementations, these bytes are 0x00.
Byte 0: Status Flags
| Bit | Meaning | Value |
|---|---|---|
| 0 | Module Present | 1 = Module is connected |
| 1 | Master Switch | 1 = Master OFF (all sections disabled) |
| 2-7 | Reserved | Not used |
| Possible Values: |
0x01 = Module present, master switch ON (normal operation)0x03 = Module present, master switch OFF (all sections disabled)I trust all of AOG’s PGNs are fully documented somewhere. Including meaning of values for each byte.
However I have not found it yet.
The PGN I found, that works for me, is not in the official PGN.MD document.
If anybody has a source for more complete PGN documentation I would appreciate knowing where.
THANKS to all who helped. All responses contributed to me getting this far.
This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.