One of the frustrating things about this was my email to simcom. I explained what I was trying to do, pointed out what they said in their documentation, what they left out that I needed, and why I was confused. They replied in an email with the documentation I just said was inadequate. I've seen this behavior crop up more frequently with people replying with something that shows they didn't fully read the situation. Unfortunately I've also been guilty of this. Thank you for spending some time on this problem. I hope to have it cracked soon.It looks like the commands are setting or clearing a bunch of bits, but that the argument is decimal. If you want to be a l33t hAxoRz then you need to understand binary.
I believe I demonstrated that I fully understand binary. I'm used to converting binary octets for sub-netting which is why I missed 262143 being an important clue as it's much larger than the 1,2,4,8,16,32,64,128 values I'm used to. I said that 200191 doesn't really fit unless that sequence activates multiple bits at once, a point you reiterated. I don't believe this to be the case.I wasn't thinking in Binary because the numbers were either much larger than the octets I'm used to and the examples were reduced by one. Thinking in binary, I wrote out the sequence (in reverse, obviously)
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144
The range for the NMEA command is 0 to 262143. This is one below the 262144 which likely means the binary sequence would be 0's with 18 1's at the end. The number of 0's would depend on whatever the bit length is. Probably 64 bits. One of their "example" lines is "AT+CGPSNMEA=200191" which doesn't really fit unless that sequence activates multiple bits at once.
Page 376 has the NMEA bit legend and at the bottom includes an important note. "Set the desired NMEA sentence bit(s). If multiple NMEA sentence formats are desired, "OR" the desired bits together."
I'm going to disregard that part of the documentation and follow my initial assumption where the "sequence activates multiple bits at once."
I've never dived into the raw GPS data before, but typing this I made a connection I missed. Each bit has a five character string of letters that corresponds with it. I've seen some of these in the buffer, but the data didn't seem to correspond with what I was looking for so I missed the connection. One of my major problems was also that in my trials I used ten seconds as the rate to fill the buffer with the data. It takes at least 30 seconds for all of the data to be sent so I set it for one minute which yielded better results.
Okay. I want bits 2, 6, 10, and 17.
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144
Those numbers would be reversed if I was constructing the actual binary sequence, but I'm just looking for the decimal number.
65536+512+32+2=66082
I'll try this out, play around some more and get back.
Statistics: Posted by MadDokK — Sat Feb 24, 2024 3:16 pm