Telstra LTE Cat-M Working on FiPy .... Just..



  • So after many, many, maaannnyy hours I have successfully got my FiPy working on Cat-M on Telstra. I have confirmed this multiple times with an end-to-end test with sending JSON data successfully back to my server.

    The downside is, it is very flaky and often requires hard resets of the FiPy unit. The solution is a combination of using AT commands and the LTE library commands provided by the latest Pycom firmware. I am no means an expert on talking with modems via AT commands and most of it was by trial and error using ideas from several threads here, but if anyone with a better idea can see what is going on / has suggestions that would be awesome.

    Firstly, my process for getting the FiPy connecting to Telstra (note this is very rough and error prone but hopefully clear enough to explain my process).

    from network import LTE
    
    lte = LTE()
    
    #set the apn
    lte.send_at_cmd('AT+CGDCONT=1,"IP","telstra.m2m"') 
    
    #set modem to full function mode    
    lte.send_at_cmd('AT+CFUN=1')
    
    #does not seem to do anything at this stage but is required as it seems it is setting some internals in the pycom comms chain that is needed                                           
    lte.attach() 
    
    #register onto the network - will take a few moments after running this command for it to be on the network                                                                              
    lte.send_at_cmd('AT+COPS=?')
    
    # wait for the attach flag to set and use the connect call
    # the modem will auto connect from the previous call regardless but still need to call this otherwise the unit does not know it's connected
    if (lte.isattached()) # obviously in reality this is a while/sleep loop, just using an if as an example
            lte.connect()
    
    send_data_to_server() # whatever you want to do here - personally I use the urequests library
    

    So now for the gotchas... This does not always work and seems to be a timing issue between the AT+COPS command and the connect call. It seems after calling AT+COPS=? the modem generally will connect fine but calling lte.connect() can reset the state and put the modem into a (crashed?) state that it will no longer accept AT commands and throws OS errors.

    You can see the status of what the modem is doing by using:

    lte.send_at_cmd('AT!="showphy"')
    lte.send_at_cmd('AT!="fsm"')
    

    showphy is good to see when we have gone from searching to connected to a cell and fsm is handy to see the state of the modem after COPS and the effect calling lte.connect() has. But again I am no expect and do not fully comprehend all the information that is available.

    From playing around, I have had the most success from calling lte.connect() as soon as the lte.isattached() comes true and sending data to my server immediately. The longer the delay, the more I see the connect call actually break/reset the connection.

    Another unfortunate side effect is that the connect seems to only stay open for a minute or so after I send the last data packet (although I have only sent payloads for a max of 2 minutes). It appears the modem again gets in a state where it stops accepting commands and trying to call any AT commands results in an exception with an OSError. I have yet to also find a reliable way to reset/reconnect without performing a complete power cycle. Combinations of disconnect, reset or deinit have not produced a reliable way of re-establishing a connection.

    So there you have it, my discovery process of a working (but flaky) LTE Cat-M connection of a FiPy to Telstra, Australia. If anyone can work on the above and see how to make it more stable or have any further ideas I would be immensely grateful.

    Also just for info, I ended up using an Aldi sim card on the basic $15 plan that I purchased at the cash register the other night. Surprising this works given I was told by numerous IoT suppliers you needed specific Telstra IoT SIM cards, of which I have and tested as well, but found I had more success using Aldi.



  • @ioag Any chance you could share your Telstra connect code? I must be doing something wrong...
    Does anyone have an update on the stability issues?



  • @timh The Pycom firmware times out 10 seconds after sending a command. "AT+COPS=?" takes longer to respond. I've seen that by hooking on a pair UART/USB bridges to the link between the ESP32 and the Sequans modem. I just wanted to see what's going on there.



  • @daniel Telstra staff gave me this value to try, worked first go :)



  • @ioag said in Telstra LTE Cat-M Working on FiPy .... Just..:

    9410

    That's interesting... I'll ask Telstra. How did you come up with the value of 9410? The central value should be 9435 according to the specs...



  • @daniel i have been able to connect consistently to LTE Telstra using below band settings:
    lte.send_at_cmd('AT!="addscanfreq band=28 dl-earfcn=9410"')

    In comparaison, latest firmware v 1.17.2.b1 is not working when I calling attach(band=28); Do you mind checking with telstra about your earfcn parameter?



  • Hello everyone,

    Apologies for the delays here. We have a session with the Telstra team this week to sort this out with their help. We'll update everyone after that.

    Cheers,
    Daniel



  • @timh that is disappointing...

    I am currently with clients overseas at the moment but have purchased some proper LTE antennas that have been delivered and also purchasing a separate LTE cat-m modem to compare. These will be the last things I try.

    Like you I am building for commercial devices and given @administrators seem to respond to every forum thread except this one and I even had a server with a device ready for them to test/play with since my first post and they still have not gotten back to me does not instill me with confidence. If I get no luck next week I will most likely go with another micro controller or the esp32 on it's own.



  • @nathanh Just tried the new firmware.

    Some observations. The only way I can get AT+COPS=? to show Telstra network is

     >>> from network import LTE
     >>> lte = LTE()
     >>> import time
     >>> lte.send_at_cmd('AT+CGDCONT=1,"IP","telstra.m2m"')
     '\r\nOK\r\n'
     >>> lte.send_at_cmd('AT+CFUN=1')
     '\r\nOK\r\n'
     >>> lte.attach()
     >>> lte.send_at_cmd('AT+COPS=?')
     ''
     >>> lte.send_at_cmd('ATI')
     '\r\n+COPS: (1,"Telstra Mobile","Telstra","50501",7),,(0,1,2,3,4),(0,1,2)\r\n\r\nOK\r\n\r\nSEQUANS Communications\r\nVZM20Q\r\n'
    

    I have tried various other combinations but I cannot see Telstra without sending the following commands between instantiating the lte entity and calling attach

     lte.send_at_cmd('AT+CGDCONT=1,"IP","telstra.m2m"')
     lte.send_at_cmd('AT+CFUN=1')
    

    Examples (each session has a power cycle resetting everything).

    	>>> from network import LTE
    	>>> import time
    	>>> lte = LTE()
    	>>> lte.send_at_cmd('AT+CGDCONT=1,"IP","telstra.m2m"')
    	'\r\nOK\r\n'
    	>>> lte.send_at_cmd('AT+CFUN=1')
    	'\r\nOK\r\n'
    	>>> lte.attach(band=28)
    	>>> lte.send_at_cmd('AT+COPS=?')
    	''
    	>>> lte.send_at_cmd('ATI')
    	'\r\n+COPS: (1,"Telstra Mobile","Telstra","50501",7),,(0,1,2,3,4),(0,1,2)\r\n\r\nOK\r\n\r\nSEQUANS Communications\r\nVZM20Q\r\n'
    	>>> lte.isattached()
    	False
    	>>> Disconnected. Press any key to reconnect.
    	> Failed to connect (Error: Port is not open). Press any key to try again.
    	Connecting on COM5...
    
    	>>> from network import LTE
    	>>> lte = LTE()
    	>>> lte.attach(band=28)
    	>>> lte.send_at_cmd('AT+COPS=?')
    	'\r\n+COPS: ,,(0,1,2,3,4),(0,1,2)\r\n\r\nOK\r\n\r\n+CEREG: 4\r\n'
    	>>> Disconnected. Press any key to reconnect.
    	> Failed to connect (Error: Port is not open). Press any key to try again.
    	Connecting on COM5...
    
    	>>> from network import LTE
    	>>> lte = LTE()
    	>>> lte.send_at_cmd('AT+CGDCONT=1,"IP","telstra.m2m"')
    	'\r\nOK\r\n'
    	>>> lte.attach(band=28)
    	>>> lte.send_at_cmd('AT+COPS=?')
    	'\r\n+COPS: ,,(0,1,2,3,4),(0,1,2)\r\n\r\nOK\r\n\r\n+CEREG: 4\r\n'
    	>>> Disconnected. Press any key to reconnect.
    	> Failed to connect (Error: Port is not open). Press any key to try again.
    	Connecting on COM5...
    
    
    
    	>>> from network import LTE
    	>>> lte = LTE()
    	>>> lte.send_at_cmd('AT+CFUN=1')
    	'\r\nOK\r\n'
    	>>> lte.attach(band=28)
    	>>> lte.send_at_cmd('AT+COPS=?')
    	''
    	>>> lte.send_at_cmd('ATI')
    	''
    	>>> lte.send_at_cmd('ATI')
    	'\r\nSEQUANS Communications\r\nVZM20Q\r\nUEUnknown\r\n\r\nOK\r\n'
    	>>>
    	
    	>>> from network import LTE
    	>>> lte = LTE()
    	>>> lte.send_at_cmd('AT+CGDCONT=1,"IP","telstra.m2m"')
    	'\r\nOK\r\n'
    	>>> lte.send_at_cmd('AT+CFUN=1')
    	'\r\nOK\r\n'
    	>>> lte.attach(band=28)
    	>>> lte.send_at_cmd('AT+COPS=?')
    	''
    	>>> lte.send_at_cmd('ATI')
    	'\r\n+COPS: (1,"Telstra Mobile","Telstra","50501",7),,(0,1,2,3,4),(0,1,2)\r\n\r\nOK\r\n\r\nSEQUANS Communications\r\nVZM20Q\r\n'
    	>>> lte.isattached()
    	False
    	>>> Disconnected. Press any key to reconnect.
    	> Failed to connect (Error: Port is not open). Press any key to try again.
    	Connecting on COM5...


  • @timh said in Telstra LTE Cat-M Working on FiPy .... Just..:

    Given a known country with only a single band it would seem that scanning all those frequencies is redundant.
    However a showphys after clearing and only setting band 28 seems to never see a different state than OFF maybe it's scanning faster.

    Haha, I saw the same thing last week and had the exact same thought and did the same test with the same results. Great minds? :). I also tried playing with the dl-earfcn value but did not have any luck either.



  • @nathanh

    Having read through the code an intersting observation is that

    lte_attach sets up explicit scanning frequencies

        lte_push_at_command("AT!=\"clearscanconfig\"", LTE_RX_TIMEOUT_MIN_MS);
        lte_push_at_command("AT!=\"RRC::addscanfreq band=3 dl-earfcn=1575\"", LTE_RX_TIMEOUT_MIN_MS);
        lte_push_at_command("AT!=\"RRC::addscanfreq band=4 dl-earfcn=2175\"", LTE_RX_TIMEOUT_MIN_MS);
        lte_push_at_command("AT!=\"RRC::addscanfreq band=12 dl-earfcn=5095\"", LTE_RX_TIMEOUT_MIN_MS);
        lte_push_at_command("AT!=\"RRC::addscanfreq band=13 dl-earfcn=5230\"", LTE_RX_TIMEOUT_MIN_MS);
        lte_push_at_command("AT!=\"RRC::addscanfreq band=20 dl-earfcn=6300\"", LTE_RX_TIMEOUT_MIN_MS);
        lte_push_at_command("AT!=\"RRC::addscanfreq band=28 dl-earfcn=9435\"", LTE_RX_TIMEOUT_MIN_MS);
    

    Then performs

      "AT+CFUN=1"
    

    Given a known country with only a single band it would seem that scanning all those frequencies is redundant.
    However a showphys after clearing and only setting band 28 seems to never see a different state than OFF maybe it's scanning faster.



  • @timh said in Telstra LTE Cat-M Working on FiPy .... Just..:

    @nathanh

    I am trying a few different antenna (which support 700-960) range to see if they make any difference, but so far no improvements. Will try and get something specific to Band 28.

    T

    That's disappointing I was really hoping that might be the cause. I am still waiting for my new antenna to arrive to test here.

    @ioag said in Telstra LTE Cat-M Working on FiPy .... Just..:

    @timh according to Adafruit that Antenna is purpose built for LTE Band28, cf below spec.

    If you look around at places that sell that antenna (core, e14, rs etc), they regurgitate the exact same details however have no link to the supplier, documentation or any specsheet, radiation patterns or testing, in fact same sites even show a different picture but deliver that antenna (for example I ordered this part specifically https://au.rs-online.com/web/p/semiconductor-development-kit-accessories/1466433/?searchTerm=146-6433 and got the antenna above) and finally if you look at the Wieson site, you can't even find that antenna listed.

    Also when it comes to antennas, companies that don't list any documentation, specifically no spec sheet or gain reports at different frequencies is an indicator of dodgy equipment. Not saying this is the case here but the warning signs I have come to learn are definitely flagging here. Just compare any info you can find on that antenna vs a more well known company: https://www.telcoantennas.com.au/site/rfi-cd7194-3g4g4gx-mobile-antenna

    @timh said in Telstra LTE Cat-M Working on FiPy .... Just..:

    This suggests we should be able to set a timeout on send_at_cmd
    After checking isattached for a while (loop with sleep)
    I check a AT+COPS again. However from then on I get errors.

    Looking through the firmware on github, it looks as if there is a timeout value being used (https://github.com/pycom/pycom-micropython-sigfox/blob/master/esp32/mods/modlte.c) and any result is posted to a global response value. So if you requested two AT commands in succession with the first one timing out, the response may come back in a subsequent command. Which is what you (and I also) see when calling COPS. If you look around on the net you will see calling COPS does take a while and most raw AT command examples put a wait command as it can take a while. Ideally, Pycom should pass through to us the ability to set the timeout and, personally, I would remove the use of a "global" response variable and ensure the correct response is returned for the correct command, which I find odd how it is being done since they are usingf a queue mechanism with a shared variables which kinda defeats the purpose of the queue. Seems like IPC/threading 101...

    Trying to solve what is going on here, I try and put on my House MD hat and look at the symptoms which are:

    a. Can connect but appears to be random with no sure way to repeat. There appears to be no real reason why this sometimes works and sometimes doesn't. Time of day, location and signal strength to towers all seem to have no visible change on this behaviour.

    b. When we do connect, is it crashes the modem after some time. Leaving the modem connected after lte.connect() and doing nothing will have the modem disconnect and/or crash in a relative short time. Sending data over a socket while connected or setting lte.disconnect() after connecting/sending a payload will keep the modem alive longer but eventually will still lose cellular connection/crash.

    c. Trying to reset the modem and connect is hit and miss as well. lte.reset lte.deinit do not always work or if the modem is crashed has no effect. Reset often requires a full power on/off.

    To me this points at a few potentials:
    a. Bad firmware on the Sequans modem itself that is having issues talking on the LTE CAT-M network on Band 28.
    b. Antenna issues that are not allowing consistent/proper radiation for the signal to work
    c. Heat/circuitry issues with the Pycom or chips involved.
    d. Bad Pycom firmware. (I add this here but looking through it, there does not seem to be anything obvious wrong or unusual so I don't think it is Pycom's use of the lte library, however, more access to some of the functions and their parameters would be useful).

    And some of the things we can tick off are:
    a. The Pycom unit is clearly able (to some extent) connect to Telstra regardless of certification
    b. The Telstra LTE CAT-M network is actually functioning in the first place
    c. The SIM cards are working
    d. Testing in multiple locations and getting similar results would seem to indicate it is not an LTE/Band28 coverage issue

    My question to @daniel @seb @jmarcelino would be, have you had any success attaching the Pycom units to a real-world LTE CAT-M network on Band 28 anywhere in the world? And is there any leverage you can put on Sequans and/or Telstra to look into this issue.



  • @ioag

    After more testing, I am finding the following.

    1. Only the first call to AT+COPS=? works, though often returns with no value, and a subsequent call say ATI will return the scan results + ATI
     >>> lte.send_at_cmd('AT+COPS=?')
     ''
     >>> lte.send_at_cmd('ATI')
     '\r\n+COPS: (1,"Telstra Mobile","Telstra","50501",7),,(0,1,2,3,4),(0,1,2)\r\n\r\nOK\r\n\r\n+CEREG: 4\r\n'
    

    This suggests we should be able to set a timeout on send_at_cmd
    After checking isattached for a while (loop with sleep)
    I check a AT+COPS again. However from then on I get errors.

    >>> lte.isattached()
    False
    >>> lte.send_at_cmd('AT+COPS=?')
    ''
    >>> lte.send_at_cmd('ATI')
    '\r\n+COPS: ,,(0,1,2,3,4),(0,1,2)\r\n\r\nOK\r\n\r\n+CEREG: 4\r\n\r\nSEQUANS 
    Communications\r\nVZM20Q\r\nUEUnknown\r\n\r\nOK\r\n'
     >>> lte.send_at_cmd('ATI')
     '\r\nSEQUANS Communications\r\nVZM20Q\r\nUEUnknown\r\n\r\nOK\r\n'
     >>> lte.send_at_cmd('AT+COPS=?')
     ''
     >>> lte.send_at_cmd('AT+COPS=?')
     '\r\n+COPS: ,,(0,1,2,3,4),(0,1,2)\r\n\r\nOK\r\n'
     >>> lte.send_at_cmd('AT+COPS=?')
     '\r\n+COPS: ,,(0,1,2,3,4),(0,1,2)\r\n\r\nOK\r\n'


  • @ioag

    Yes I am sending AT+COPS?
    But I never see True returned from isattached.
    Often the send_at times out when sending AT+COPS?
    Following up with something like ATI returns the output of the COPS? plus the ATI response.



  • @timh I have been able to attach usually few times a day, don't seem to be any reason why most of times it does not success.

    In your implementation make sure:

    • you call attach before you send 'AT+COPS=?' command; that command takes <10 seconds to return
    • wait at 60 seconds for attachment by calling isattached() in a loop (don't forget sleep .5 second in there)

    good luck.



  • @timh according to Adafruit that Antenna is purpose built for LTE Band28, cf below spec.

    Connecting my fipy to Telstra is also a hit and miss for me and I am running out of idea as to why, Telstra or Pycom firmware???

    Specifications from Adafruit site: https://www.adafruit.com/product/3623
    LTE band 28/38*2
    Frequency: 703~803/2520~2620(MHz)
    Antenna size: 75 x 21 (mm)
    PCB 0.6 mm
    Low bands

    (5, 8, 12, 13, 18, 19, 20, 28)
    Tx frequencies 699 to 915 MHz
    Rx frequencies 729 to 960 MHz
    Mid bands

    (1, 2, 3, 4)
    Tx frequencies 1710 to 1980MHz
    Rx frequencies 1805 to 2170 MHz



  • @nathanh

    I am trying a few different antenna (which support 700-960) range to see if they make any difference, but so far no improvements. Will try and get something specific to Band 28.

    T



  • @timh said in Telstra LTE Cat-M Working on FiPy .... Just..:

    Hi
    Has any one made any further progress with this?
    I find I can only occasionally see the Telstra Network.

    I have the exact same, it only connects occasionally. I am starting to suspect the antenna is the issue. I notice that when I did finally achieve a connection the signal strength was between -109 to -97 which is pretty poor given I am under full cover. Also listing all the viewable cell towers only had signal ranges between -115 to -95.

    But interestingly, when I changed the polarisation of the antenna to be vertical instead of horizontal (e.g. instead of lying the antenna flat I put it standing up using a ceramic cup), I got almost a 40db increase and when connected to a tower was getting -59db. Now this sounds good but in reality antennas made for modems should not be so sensitive to correct polarisation, this is something more for equipment running in the 400mhz band. Also, polarisation should never have such a dramatic change, especially when a 3db gain is effectively doubling the power/gain.

    This observation tells me the antenna is not tuned correctly and while having it in a different orientation (standing up like the the letter E with an extra line haha) will give a better receive signal, it is so extreme that I expect that the transmit is still not getting out and I imagine more signal is leaking out through the connector than the actual antenna, at least on band 28. The further seems to be the case as even when I see every tower between -65db to -57db I still only occasionally connect.

    Saying all that, happy to be told I am wrong and there is more magic button/switch/setting that will fix anything because I am dying to get this LTE working as described.



  • Hi

    Has any one made any further progress with this?

    I find I can only occasionally see the Telstra Network.

    >>> lte.send_at_cmd('AT+COPS=?')
    '\r\n+COPS: (1,"Telstra Mobile","Telstra","50501",7),,(0,1,2,3,4),(0,1,2)\r\n\r\nOK\r\n\r\n+CEREG: 4\r\n'
    

    Most of the time I get nothing - empty string,+COPS: ,,(0,1,2,3,4),(0,1,2)

    >>> print(lte.send_at_cmd('AT+COPS=?'))
    
    
    >>> print(lte.send_at_cmd('AT+COPS=?'))
    +COPS: ,,(0,1,2,3,4),(0,1,2)
    OK
    

    And even once AT+COPS=? has listed the Telstra network, I have never been able to successfully attach.

    Thanks

    Tim



  • Does anyone know if there are any AT commands that report any network/cell tower information that the modem is seeing before it attaches to a network? All the commands I see only show info after you have attached.

    Also, I can't see to find any reference or documentation in the Sequans manual on the following commands which are in the Pycom firmware (also tried general google searching but nothing came up).

    AT!="clearscanconfig"
    AT!="RRC::addscanfreq band=28 dl-earfcn=9435"
    AT!="fsm"
    AT!="showphy"
    

    I can guess what they do and piece some of the information out of them, but knowing exactly what all the values means, especially with showphy and fsm would be really helpful.

    Cheers,
    Nathan


 

Hello World?

Pylife on Kickstarter - November 2018








Back Us On Kickstarter >

Pycom on Twitter