@thijsbuuron zie: UDP manual
Posts made by Andre Rodenburg
-
RE: All steps to succesfully send UDP messages
@techniek Nice! Do you also have the zoomed-in screenshots? (just the TX peak). I also notice a large current spike when sending a message with fast release (second picture). What is this?
-
All steps to succesfully send UDP messages
These are all the steps I performed to succesfully send UDP messages on my device.
Before you start:
- Turn your device off
- Do not send any messages before completing all the necessary steps in postman
- The manual is intended for people who have previously registered a CoAP device
- AT-Commands can be manufacturer and model specific. Refer to the datasheet for your device for the correct set of AT- Commands.
Postman:
-
Make sure you are logged into postman and have User SK0002 selected as your environment.
-
(UI) Get all devices. If you have previously registered your device for CoAP, you have to delete it first to use it for UDP. Make a call to: ‘(UI) Get all devices’ to find your device. Look for: “id”: 803 for example. If you have multiple devices, make sure you delete the correct one by comparing the IMEI number, it should be the same.
-
(UI) Delete device. Delete device with <id>: DEL {{base_url_cdp}}/rest/device/<id>.
(So not your IMEI!) See step 2 to find the id for your device. Return should be empty. -
Get resource subscriptions. Make a call to: ‘Get resource subscriptions’ If you have previously registered a resource subscription for your device you will have to delete that as well. Look for the subscription that shows your IMEI number, like this:
“serialNumbers”: [“IMEI:<your IMEI>”] -
Copy your subscription id. Select and copy (ctrl+c) the subscription id attached to your resource subscription. It should look like this: “subscriptionId”: “xxxx-xxxx-xxxx-xxxx-xxx”,
-
Delete subscription. Delete the subscription found in step 5. The API call you make should look like this: DEL {{base_url_idc}}/m2m/subscriptions/<subscriptionId>
Return should look like this:
{
“msg”: “Success”,
“code”: 1000
} -
Make sure everything is deleted. After completing steps 1-6, make a call to (UI) Get all devices and Get resource subscriptions. If you had only one device registered, these should now both be empty. If you had multiple devices registered, the device you deleted should not be in any of the lists.
-
Change the adaptation layer. We need to change the adaptationlayer to use UDP on our device. In postman, go to: manage environments -> User SK0002 -> adaptationLayerName -> It should be ‘TMNL_COAP_AL’. Change it to ‘TMNL_UDP_AL’.
-
Register your device for UDP. Make a call to: POST (UI) Register endpoint (Device)
{{DeviceId}}. Make sure you changed the adapation layer in step 8 before performing this step. Also make sure you are registering the correct device by checking the IMEI number in: manage environments -> User SK0002 -> DeviceId. The IMEI should look like this: IMEI:<your IMEI>. Important: do not use any spaces, this will register the wrong IMEI number. -
Register your resource subscription. Make a call to: ‘Register subscriptions: (resources)’. {{DeviceId}} should still be the same as the previous steps. Return should look like this:
{
“msg”: “Success”,
“code”: 1000
}
Register your application. Register your application by calling ‘Register application’. Your application should return a 200 (OK) response.
On your device:
- Attach to the network as usual. Make sure you are attached by using the AT- Command: AT+CGATT? This should return +CGATT: 1 if you are attached.
- Open a UDP socket. On the uBlox SARA-N211 modem the AT- Command is: AT+NSOCR=“DGRAM”,17,7000,1. ‘17’ = UDP protocol. ‘7000’ is the local port number.’1’ = incoming messages will trigger a +NSONMI URC. Opening a socket should return the socket number (0).
- Send a UDP message. On SARA-N211 the AT- Command to send a UDP message is: AT+NSOST=0,“172.27.131.100”,15683,4,“45726963”. ‘172.27.131.100’ is the T-Mobile CDP. ‘15683’ is the remote port number. ‘4’ is the data size in bytes. ‘45726963’ is the data. Sending a message should return the socketnumber and the amount of data successfully sent (0,4).
If you completed all steps successfully you should now be receiving data in your endpoint!
(If you have any questions, ask away!)
-
RE: Can't register endpoint
@paul-koenen Heb je al een andere backend geprobeerd? Heb vandaag tijdens het installfest zowel UDP als CoAp gebruikt en bij beide protocollen komen de berichten netjes aan in de backend…
-
RE: UDP op het impact platform met SARA-N211
@thijsbuuron Ik zal binnenkort een topic maken met alle stappen die ik gedaan heb
-
RE: Can't register endpoint
@paul-koenen Het beste wat je dan kan doen is alle devices / subscriptions verwijderen, je device offline laten en manual part 2 opnieuw doen. Pas als alle stappen voor het backend succesvol gedaan zijn op het device de attachment doen en probeer dan data te versturen. Ik heb gemerkt dat als je attached / data probeert te sturen voordat alles goed staat in postman je device niet meer bruikbaar is.
-
RE: Sodaq SIM gemigreerd, hoe verder met Postman
@pe1mew Misschien kun je proberen SSL certificate verifcation uit te zetten. (file > settings > general).
Eventueel kun je ook alle instellingen nog een keer nalopen in de postman environment (manage environments > USERSK002). -
RE: Can't register endpoint
@paul-koenen Wat zegt de api call “get all devices?” (dus niet registered). Bij deze api call heb ik twee devices in mijn lijst staan waarvan ik eentje heb gebruikt om data te sturen, ditzelfde device staat ook in de lijst “get all registered devices” (en de ander dus niet). Ik ga er daarom vanuit dat “get all registered devices” alleen devices laat zien die al een keer data gestuurd hebben… misschien dat @afzal_m dit kan bevestigen?
-
RE: Sodaq SIM gemigreerd, hoe verder met Postman
@pe1mew Je hebt iets als dit nodig:
GROUPNAME XX_XXXX
USERNAME naam.achternaam
PASSWORD ImpactXXXMisschien in je spamfolder?
Anders even een mail sturen naar: rowan.schaaf@t-mobile.nl -
RE: Sodaq SIM gemigreerd, hoe verder met Postman
@matszs als het goed is heb je die ontvangen van @Rowan-Schaaf of @afzal_m
-
RE: With one send command, receiving more than one SubscriptionId
Het waren dus echt “resend” messages, omdat het Nokia Impact platform nooit een OK response van me kreeg. Makes sense.
Heb ik ook weer wat nieuws geleerd
-
RE: With one send command, receiving more than one SubscriptionId
@elfred-nieuwamerongen-van Je kunt het beste zowel postman als je arduino een keer nalopen:
- Probeer alle GET commando’s in postman en kijk of je onverwachte dingen ziet
- Loop de software van de arduino nog een keer na of er niet per ongeluk een loop of een herhaling in zit
De data die ik dan binnenkreeg was weinig van te maken. De payload kende soms wel 44 arrays met data.
- Wanneer je binaire data stuurt word deze in je applicatie ook in binair formaat ontvangen. Er zal in de applicatie dus een vertaalslag gemaakt moeten worden om de originele data weer terug te krijgen.
Als laatste kan ik je de tip geven om een terminalprogramma te gebruiken. Hiervoor heb je de passthrough sketch nodig, je kunt dan handmatig AT-commando’s sturen wat erg handig is voor debuggen.
-
RE: With one send command, receiving more than one SubscriptionId
@elfred-nieuwamerongen-van You have to explain a little more about your problem. What do you mean with ‘resends’? You can also talk Dutch if it helps
-
RE: With one send command, receiving more than one SubscriptionId
@elfred-nieuwamerongen-van You can try api call ‘get resource subscriptions’ in postman to see if you have a double data subscription
-
RE: Spook device | device already exists - iTotalDisplayRecords=0
@afzal_m said in Spook device | device already exists - iTotalDisplayRecords=0:
@blaataap said in Spook device | device already exists - iTotalDisplayRecords=0:
Kan dit te maken hebben met: “PLEASE DO NOT SEND A MESSAGE (AT+NMGS) BEFORE REGISTERING THE IMEI NO. IN OUR CONNECTION AND DEVICE MANAGER”?
Ik denk het wel. Ik zag weer een hoop verdwaalde IMEI nummers op ons netwerk.
Heb die zojuist verwijderd, dus je kunt het opnieuw proberen!
Heeft het toevallig ook iets te maken met deze melding?
{
“msg”: “Device already exists”,
“code”: 3001
} -
RE: New Sodaq SARA module
@paul-koenen said in New Sodaq SARA module:
@Andre-Rodenburg Bedankt voor het meedenken en zoeken, ik heb het probleem al opgelost!
Misschien dat je mijn andere vraag wel kan beantwoorden, Waarom is er overgestapt van OceanConnect naar Nokia Impact? wat is de reden?Ik denk dat @afzal_m of @Eric-Barten daar wel een antwoord op heeft
-
RE: New Sodaq SARA module
@paul-koenen Hier kun je bijna alles wat je nodig hebt wel vinden: Sodaq NB-IoT
-
RE: New Sodaq SARA module
@paul-koenen Heb verder geen ervaring met het nieuwe SARA board maar als de hardware anders is is het slim om alle poortnummers en instellingen langs te lopen in de arduino software. De oude voorbeelden zijn trouwens gebouwd voor oceanconnect en gaan niet werken voor impact zonder modificaties.
-
RE: New Sodaq SARA module
@paul-koenen Waar krijg je deze feedback? Gebruik je één van de arduino voorbeelden van sodaq?
-
RE: https://devreg.iot.t-mobile.nl/devices Connection timed out after 30000 milliseconds Failed to login the devices service Connection timed out after 30001 milliseconds
@alcatrez Connection & device manager = Impact. Maar ja dat die link voor het oude platform nog steeds beschikbaar is maakt het wel een beetje verwarrend
-
RE: https://devreg.iot.t-mobile.nl/devices Connection timed out after 30000 milliseconds Failed to login the devices service Connection timed out after 30001 milliseconds
@alcatrez Die tool werkt nog met oceanconnect dus is niet meer ondersteund volgens mij. Je kunt in postman je devices beheren voor impact
-
RE: Basic Auth
@paul-koenen Misschien is het een idee om eerste een stapje terug te doen, probeer het eens werkend te krijgen in node-red met een simpele http-in en http-response. Ik kan bevestigen dat het nog steeds werkt met node-red.
-
RE: unsubscribe
@paul-koenen Hoi Paul, als je opnieuw de collectie van T-mobile import op postman krijg je een aantal extra API calls, hiermee krijg je onder andere de optie om subscriptions te verwijderen.
Misschien ook handig om te weten voor anderen, als je deze stap van het manual opnieuw doet krijg je een aantal extra API calls: IMPACT manual Part 2