-
-
-
-
The rx and tx pins are swapped for the bc95 vs the m35 module.
I'd suggest you update the firmware on the bc95 as well. This presents a challenge in that you need to solder some wires to the bc95 to a usb->serial converter. I use the usb base board for this. There's a windows program from quectel that does the firmware upload. You can also do this 'over the air', but I've not tried this.
-
-
-
-
I use a nRF52dk and it works fine from my mac as Gordon describes. I build Espruino and do everything on a macbook pro.
Note: the 8211 uses a BC95 cell module and a L70 GPS.
The 8212 uses the BG96. The BG96 GNSS has GPS and Glonass, so it has better performance.You probably want to update the BC95 firmware at some stage. I just did mine today. It requires a bit of jiggery-pokery to do. You need to solder some jumper wires from two resistors on the board to the uart pins. You can then use the usb->serial board to download new firmware - you need Windows for this as the Quectel app is windows only. It works well running a Win7 VM using Virtualbox.
-
-
-
-
I'm struggling getting it to work reliably at the moment. There's just been new firmware released for the BC95 but I've yet to check to see if the problems I've encountered have been fixed. Then there's the challenge of updating the firmware - I've soldered some wires to bridge the BC95 serial to the usb->serial board so I can do this.
The first trick to getting the BC95 working is to swap the gprs tx and rx pins (12 & 20) in rak8211.js. It's easy enough just to hand edit the min.js file as it is the first line.
-
That code is like decoding a puzzle! I saw the 256 + bit and I'm thinking What!! Then I twigged that it is to ensure there's at least two hex chars. Thanks for the tips.
Unfortunately the Quectel BC95 uses hex ascii. Why? Who knows. I can't think of any other AT module that does it that way.
We were having some memory problems especially when receiving, so I had thought my code was not too efficient. I had it in my mind that there might be a simple way to use a byte array and cast it to a string. That way there's no copy and allocate.
-
-
The Quectel BC95 module expects the data payload as hex strings. Are the following methods, the most memory efficient way of doing this?
//convert to a hex string for (var i = 0; i < data.length; i++) { var s = data.charCodeAt(i).toString(16); while (s.length < 2) { s = '0' + s; } msg += s; }
and conversely:
for (let ndx = 0; ndx < (recvData[1] * 2); ndx += 2) { let i = parseInt("0x" + recvData[2].substring(ndx, ndx + 2)); //ascii hex to integer sockData[connection] += String.fromCharCode(i); //build a string }
From my limited understanding, this code would create a string, append and create a new string, rinse and repeat. This seems like a bit of overhead. I did consider typed arrays, but how do I convert these back to a string in one go?
-
-
-
-
-
I'm thinking your code expects an "OK" from the AT+QISEND. This doesn't happen. The sequence should be:
AT+QISEND 0,365\r\n
response is \r\n>[space]
send data
response is \r\n SEND OK\r\nThus the current send function in QuectelBG96.js is borken. My current thought is there was a timing issue with the way the original code handled send but it worked most of the time. Adding extra time probably 'fixed' this. On top of this, sometimes there seems to be a discrepancy between the length of data we think we send and what the BG96 thinks it got - I've yet to narrow down on this. Setting flow control seems to help.
-
-
-
-
A new day and a fresh perspective! I've hooked up the logic analyser and what seems to be happening is that the BG96 isn't receiving enough bytes only sometimes when doing the QISEND. It's expecting 536 bytes and we send around that amount. When it fails, it doesn't give the SEND OK until the next command comes along, which in my case is around 1 second later. That command fails as it gets gobbled up as data. What I am not sure of is which end is at fault. I'll hook up the CTS line to the analyser to see if the module wants us to stop or if the espruino code is not always sending what it should.
Watch batteries have no hope of powering the cellular module. You need to use Lithium Ion batteries. Unfortunately the RAK8212 has a poor voltage regulator that draws more current than the cellular module in sleep, so this module is a poor choice for something that has to run for a long time.
As for waterproof cases, there's many suppliers of IP rated enclosures.