AtomDTU NB-IoT



  • Hello @Felix22

    ok, so it seem that the modem is registered with Swisscom, but doesn't get an IP address since AT+COPS? succeeds, but AT+CGCONTRDP fails.

    At this point I am not sure what might be the issue. Is there anything in the q.beyond portal, like a log showing some error?

    Also since you used your iPhone with that SIM card before there might be some kind of security check not accepting a connection from a different device. On the q.beyond portal, is there a way to reset / clear the data from the previous connection?

    Thanks
    Felix



  • Interesting, this is the response from the DigitalRepublic-SIM-Card how has no NarrowBand.
    He see the Network also...
    0_1708297944952_298947a5-15ca-4ffb-9d38-ba507125f028-grafik.png

    Now, ih have deactivated and new activated the SIM.
    0_1708299667609_8d6a03a6-055a-400c-81b1-6a1d0b20b0a1-grafik.png

    Now its a "3" = "Operator forbidden" (?) (Swisscom)
    and
    1 for sunrise



  • Hello @Felix22

    hmm, strange. Do you know which roaming partner (Swisscom and/or Sunrise) q.beyond has in Switzerland for NB-IoT? Maybe worth checking with q.beyond support.

    Thanks
    Felix



  • Many thanks.

    I will write to the support from q.beyond.

    If the connection will go on. What are the Code for an MQTT connection ?
    If i become an IP-Address, can i use the "normal" MQTT Blockly ??

    Regards,
    Felix



  • Hello @Felix22

    please refer to the SIM7020 documentation for MQTT commands. You can find the PDFs here - section Related Link.

    As soon as the modem gets an IP address the last AT command AT+CGCONTRDP sent by Init NB-IoT DTU block should succeed and then you can use all the other MQTT blocks.

    Thanks
    Felix



  • a.beyond say, she works in Switzerland with Swisscom NB.
    How can I explicit connect to Swisscom (AT-Command) ?



  • Hello @Felix22

    AT+COPS=1,2,"22801"

    Thanks
    Felix



  • b'AT+CSQ\r\r\n+CSQ: 18,0\r\n\r\nOK\r\n'
    men, i have a signal ?

    b'AT+CSTT="iotsim.melita.io","",""\r\r\nOK\r\n'
    b'AT+CSTT?\r\r\n+CSTT: "iotsim.melita.io","",""\r\n\r\nOK\r\n'
    APN is set correct ?

    b'AT+CGREG?\r\r\n+CGREG: 0,5\r\n\r\nOK\r\n'
    Registered ?

    b'AT+COPS: 1,2,"22801"\r\r\nERROR\r\n'
    b'AT+COPS?\r\r\n+COPS: 0,2,"22801",9\r\n\r\nOK\r\n'

    b'AT+CGACT?\r\r\n+CGACT: 1,0\r\n\r\nOK\r\n'

    If i have a connection, do i become an ip-address ?
    with the command AT+CIFSR



  • Hello @Felix22

    it is my understanding that AT+CIFSR returns the local IP address in a TCP or UDP connection. (It's an AT command for compatibility with SIM800.)

    See PDF document SIM7020 Series_TCPIP_Application Note_V1.04 - 6.2 TCP Client Connection. You'll find the link to the PDF here.

    The way I use to set the APN is described in the same TCP/IP PDF - 3.2 APN Manual Configuration.

    Thanks
    Felix



  • 0_1708381086058_d7703b57-eaf8-471b-809b-c995d219f6fa-grafik.png

    Result:

    b'\r\nOK\r\n'
    b'\r\nOK\r\n'
    b'\r\nOK\r\n'
    b'\r\nOK\r\n'
    b'\r\nOK\r\n\r\n+CPIN: READY\r\n'
    b'\r\n+CGREG: 0,5\r\n\r\nOK\r\n'
    b'\r\n+CGCONTRDP: 1,5,"iotsim.melita.io","10.xx.xx.xx.255.255.255.0",,"212.xx.xx.xx","212.xx.xx.xx",,,,,1500\r\n\r\nOK\r\n'

    Im a big step wider... now, i have become my ip address... :-)
    Now i think... MQTT, next step.



  • Juhuuuu !!
    It works !
    More Information and the solution will follow...

    @felmue : many thanks

    Felix



  • Hello @Felix22

    I am happy to hear you got it working.

    Thanks
    Felix



  • now, i have a new problem.
    The mqtt broker test.mosquitto.test is working with my Blockly but my own Broker on my Server at home in a Docker container is not available from AtomDTU. But with a Internet Test Tool, it is working ( https://testclient-cloud.mqtt.cool/ )

    0_1708530061363_13981671-0c96-43c5-9d60-043ca4ba25b6-grafik.png

    I see no difference...
    The orange part is working and the tree other is not working



  • Hello @Felix22

    hmm, that's a tricky one. Now that your modem gets an IP address; have you tried the official MQTT blocks?

    Thanks
    Felix



  • you mean the blocks at "Fortgeschritten" / MQTT ?
    over there it connects over Wlan/Wifi...
    Is there a MQTT-Block how i can say the RX and TX pin ?



  • Hello @Felix22

    no, I meant in UIFlow1 with M5Atom selected. Then it's under Base - DTU - NB-IoT - MQTT. There even is an MQTT example.

    0_1708568772576_UI1_NBIoT_DTU_20240222.png

    Thanks
    Felix



  • this hangs by the "Init NB-IoT DTU" Blockly if you have not Load the Unit NB-IoT.
    But with the NB-IoT-Unit and the correct RX/TX Pin's it works fine.

    0_1708613718672_fedaa32a-bb09-4ea0-932d-d74fcb0bee74-grafik.png

    Do you also use the Atom DTU NB-IoT ?



  • Hello @Felix22

    not exactly; I use an C-Back NB-loT Global version (SIM7020G) which I connected to an M5Atom the same way it is connected in the AtomDTU NB-IoT.

    And no, I do not need to add the NB-IoT unit for the Init NB-IoT DTU block to work.

    Thanks
    Felix



  • Hello @Felix22

    I have successfully connected, subscribed and published to the following free MQTT brokers: mqtt.m5stack.com, broker.mqtt.cool, test.mosquitto.org, broker.hivemq.com, broker.emqx.io, and public.mqttserver.eu using below UIFlow:

    0_1708675376620_UI1_MQTT_Broker_Test_20240223.png

    Thanks
    Felix



  • Do you have a list with the Status Codes ?
    Signal Qualit├Ąt: 16
    MQTT-Connection: 0
    Network-Registration: 7
    GPRS network registration