Hi Rainer
Firstly… don’t pull up or down the TXD/RXD lines… Remember that transitions on TXD will cause a wake up. We don’t pull the lines and have no issues.
Secondly… ALWAYS turn hardware off… Bread and butter off low power battery. If it ain’t on, it ain’t drawing power. (see exception below) Personally, I only leave on what is necessary. Console RX, IO etc.
Exception to this is the BC660… leave it on and rely on the PSM modes. Another ‘feature’ … NB/IoT searches for comms channels on power up. In New Zealand this takes 10 minutes, in Europe, this can take up to 30 minutes. If I change provider or APN (I’ve done this for testing) 20 - 25 minutes before its ready again… that’s 20 - 25 minutes of battery drain. From what I understand, NB/IoT devices check all cell towers, and all bands for the best channels to use and the best providers so in theory, you can use a global sim and multiple providers.
I am taking MQTT (over TCP) but I am gathering a whole day of logs and sending them twice a day, we are talking 1.5k per call roughly, but because I only call every 12 hours, I (should) get 7 years of a Lithium Primary C cell.
I do notice it takes quite a few seconds to send a frame. I do need to frame balance (i.e. send 2 x 529 byte frames instead of 1009 + 49) as sometimes the frame doesn’t get through.
[163658] send: 1009
[163713] Got “+QMTPUB: 0”
[163714] send: 49
[163724] Got “+QMTPUB: 0”
[hhmmss] = 15 seconds + 10 seconds
Call time 64 seconds, 11 logs sent
Vodafone here also recommend NOT using MQTT, since it uses TCP/IP. But the company I work for use MQTT. I set timeouts, retries and version at the start so I don’t get as many failures.
With 350 bytes, I would consider UDP or COAP, both will give you a decent performance gain, but not Confirmed Delivery. you can manage this by requesting confirmation for selected entries. Don’t expect Quectel to make CoAP available, what I’ve heard is the have no flash space (or don’t see it as important) so you have to do it yourself. And Please… think of security … login, passwords, encryption.
Also be aware there is a 1024 byte character limit (512 hex bytes or 1024 ascii characters). I use BASE-64 encoding because of this limit.
I believe NetLight only pulses with a poll from the network (so you have to have a sim card as well). The BC660 spends most of its time in deep sleep and disconnected from the network, Mine is only awake for a minute every 12 hour, so you are unlikely to see anything at all.
Note: We don’t have NETLIGHT connected, so I don’t know exactly what it does and when.
My Init Sequence (simplified a bit, but all the steps are there):
Firstly bunch of AT’s at different speeds to work out the baud rate. with a reset between them (this only happens when I first power on)
send “AT\r\n” … up to 4 times to get a response
[042635] NBIOT has responded.
send “ATE=0\r\n”
[042636] Echo mode turned off successfully.
send “AT+CGSN=1\r\n”
[042636] The IMEI number is: 866207058354238.
send “AT+QCCID\r\n”
[042637] The CCID number is: 6401200307927925.
send “AT+CIMI\r\n”
[042637] The IMSI number is: 530011114927925 (53001).
send “AT+CFUN=?\r\n”
[042638] AT+CFUN=1
if not, send “AT+CFUN=1\r\n”
send “AT+QBAND=?\r\n”
[042638] Frequency bands: “3,8,28”
send “AT+CPSMS?\r\n”
[042639] send: AT+CPSMS? (“00101110”,“00000101”)
check result matches expected results. PSM is set to 2 hours past my call in time, So I control the call in
send “AT+QICLOSE=1;+QICLOSE=2;+QICLOSE=3 … \r\n”
[042640] All ports closed
send “AT+CGDCONT?\r\n”
Check returned APN, set if not correct and resent BC660
send “AT+CSQ\r\n”
[042641] Signal Strength: -97 dBm
[042642] ***** End of call 7 s (11) *****
Typically I wait 60 seconds after power up or reset before attempting this, (apart from AT\r\n baud rate detection & AT+I\r\n Identification).
After this, I wait 10 minutes before attempting sending a frame, usually attempting to connect won’t work during this time.
Once I’ve successfully call in at least once, I go straight from the AT\r\n to AT+CGDCONT?\r\n. If I fail 5 times in a row, I reset the BC660 and go through the whole sequence again (10 minutes after reset).
As you can see, I don’t change much, I don’t do any pre-configuration either. Some of the changes require a reset of the BC660 which I do via the reset line. My ISR automatically detects responses and sets flags appropriately, That way the CPU is effectively sleeping so all I have to do is send a command, and sleep until the status changes.
Note: If you get a NB/IoT SIM, it should register automatically, Set the APN via AT+CGDCONT (once) then set +CFUN=1 (also once) and its connected … but it does take 20 - 30 minutes here in NZ, not sure about Aussy so just be patient. The webinar from the UK, the guy said go make a cup of tea… I would suggest go have a beer (or coffee). My Personal experience: AT+CSQ returns 99 during this time, so no signal = trying to find a channel. I haven’t fond a way to detect its trying to find a provider/channel - but also haven’t looked very hard.
Another one… Vodafone (and Spark here) don’t hold a channel more than 3 hours. if you request a 12 hour PSM sleep, it will dump all the session info after 3 hours, For Vodafone, I send multiple AT+QMTOPEN= … at 1, 2, 4, 8 … second intervals (power of 2), usually gets through on 4th or 5th attempt. Spark require you to reset the BC660 and to re-establish the connection. If you are doing this commercial, they will have a hared APN or private APN which doesn’t forget you. Or just limit you connection interval to a maximum of 2.5 hours or similar.
As far as waking the BC660… just send multiple AT\r\n until you get an OK response with 500ms between (I send up to 10, but it never requires that many)…
Simon