I have a device which has a settings on it.
The device is uploading data to the cloud.
In the cloud I have settings of the device that I want to do a smart way to update the device settings, but still leave the device the master and stateless. I mean that every request shall come from the device towards the cloud and NACK/ACK will come back to the device.
Currently what we do is to put a command in the database to send to the device according to its serial number. when the device pings to the server, it gets the message with the update. But I do not want to wait for the ping of the BSS. How can I notify the device that a message is waiting for it ?
How do Apple does it with icloud settings to the devices ?
Thanks
Look at the MQTT protocol. This is being promoted by Amazon for IOT devices, and a broker (message router) is available from Amazon. The protocol uses a publish and subscriber model. The devices subscribe to their "topic" something like yourcompany/todevice/serialnumber, and when the server publishes to the same topic, the MQTT broker delivers the message. the messages normally use JSON protocol.
Related
I'm building a project where I use 2 ESP8266 and 1 ESP32 devices, where I collect data with sensors on ESP8266's and send those gathered data to ESP32. Then, this ESP32 device sends an HTTP request (w/ HTTPClient) to my NodeJS Web Server, with the data received, which will eventually be processed there and saved to the database.
I'm having a problem though; when I use some mock data, and use only ESP32 without ESP-NOW and any other connection with other devices, I get status code 200, which indicates that my HTTP Request is sent succesfully. And when I use ESP-NOW to establish conenction between ESP devices, and not send any HTTP Request, I can successfully send and receive data.
However, when I use ESP-NOW to send and receive data, and send the data using HTTPClient request to my Web server on ESP32, I get status code -1 (refused connection). I couldn't find any other issues regarding this topic, so I figured I might ask for some help.
I have also used painlessmesh library to send/receive data between ESP devices, but that gave me the same exact issue. I'm using Wifi mode STA on my ESP32 device, which I connect it to my router to connect to the internet.
Thanks in advance for any help and support.
You cannot use ESP-NOW and WiFi in parallel at the same time; it's either-or. Exception: if you use the same channel for both (may not be possible)!
Option 1
You can alternate between the two protocols. So, as soon as the ESP-NOW transmissions from node 1 has completed (data fully received) you turn off ESP-NOW, connect to WiFi, publish via MQTT and then reverse. Needless to say that while your ESP32 is on WiFi you cannot receive data via ESP-NOW from either node 1 or node 2.
Option 2
Use some sort of gateway between ESP-NOW and WiFi. This product for example contains two ESP32 (connected over UART), one for ESP-NOW, one for WiFi: https://thingpulse.com/product/espgateway/. Disclaimer: I am a ThingPulse co-founder.
It is possible to run a web server and esp_now in the same esp32. Check my code here https://github.com/Servayejc/esp_now_web_server for the server
https://github.com/Servayejc/esp_now_web_server for the sender
This code make also automatic pairing of the nodes of esp_now.
This code is based on randomnerdtutorial…
Can someone describe the APNs architecture to me in regards to:
How does the handshake work when authenticating from server to client, for a push-notification?
How does the APNs know when to send a push-notification to a phone after it's been turned off (push notification would have been originally sent to the phone at that time). Does the phone know to ping the APNs when it first boots up?
Telecoms is complicated and has evolved over time. An APN is not exactly an internet domain. It is used to establish a PDP context which sets up a tunnel to the home provider to allow packets to be exchanged, this maybe an internet connection. The apn is a name to indicate which network your device is part of, the hlr/hss from the operator will know if your sim is provisioned for that apn. The sim does the mutual authentication between terminal and network, the sim has a identical chip as your payment-card. It contains a secret and logic to verify it knows that secret.
The network can wake up a non-transmitting device, this can be a data-sms, but there is also a signal to send a push to the terminal. The hlr/hss has a message waiting flag indicator, so a switched off device will receive an sms, just one that is processed invisibly and would actually pling on your phone.
As I said, telecoms is complicated so my explanation is more storytelling than reading 3gpp specs.
How do I implement notification in BLE?
I have a smartphone, and every hour it will send notification to all nearby BLE devices (smartwatch, RFduino, etc) for time synchronization purpose.
Other devices are server now (since it provides data), and smartphone is the client that collect the data.
Could I piggyback into the advertisement packages? For example, the smartphone always broadcast an advertisement packet to annoucement its presence (that's how other devices can find it). Can I modify that packet to be a time sync?
In order to send notifications or advertisements, your smartphone has to act as a server, which also means that in order to be able to receive notifications or scan for advertisements, your peripheral devices must act as clients.
This can be a bit tricky, because if two devices act as client and server, they may not simultaneously fulfil the other role. You need to switch roles whenever needed, which is an open field for all kinds of problems.
Also, I am not convinced that it is really the optimal choice to let the smartphone regularly notify all devices in the vicinity. Each of the devices that wants to receive the notification has to be connected with the device in order to receive the notification, and this connection has to be already active when the notification is sent in order to really get the correct time. So all these devices need to connect in advance to the expected notification time, and hold up the connection until the notification has come.
It might be better to just advertise the current time, but remember that you can't connect to the smartphone as a server while it is advertising, because the link layer may not be in scanning and advertising mode at the same time, and you may also not be connected when advertising for a similar reason.
If you want to do it that way, you can include the time information in the advertising data. See the Supplement to the Bluetooth Core Specification v6, Part A for further information on the structure of the advertising data. You could put it in the manufacturer specific data.
However, another option would be to write the time directly to the device using a write request. You can define your own service and characteristics. You can include a "time synch necessary" information in the advertisement data of the servers, and when the smartphone evaluates the advertisement, it can connect to the corresponding device and send the time directly.
The advantage of this procedure is that time is only updated if you really need it on the device, and that you do not have to switch client/server roles, because the device in server role may advertise as normal, and the smartphone can always stay in client role.
Is there any way to initiate an SMS MO from a device from the network. Eg: Can I send a special USSD push to a device from the network so that it will SMS a specified text to a specified number from the device.
Only if you are the network operator and the USSD message is defined in the network and supported by the device.
You could also send a MT SMS and get the specified text as a reply (again supported on the device, obviously).
This largely depends on the device capabilities. The device needs logic for processing the USSD message, instead of just displaying it, and to trigger sending the MO SMS.
Since this is not a factory configuration, you would need a custom application to be installed on the device, provided that the device platform allows for the needed functionality. For example some J2ME-capable devices do have this functionality. Consult your device manufacturers development documentation.
I am doing a project for sending bulk sms service.this is the concept
create a website . Through this website the user will enter all their details so that only registered user can use my service.I ll get a service plan from any of the service providers for sending unlimited messages.They ll give me a SIM card with a unique number like 54545.My android application interfaces with the gsm modem and sends out the messages from my machine.
now,i wanted to know what kind of modem i can use for my project.Is there any modem to send only bulk sms
You might be looking for a GSM/GPRS-Terminal like these. I have used one to send SMS after a application has finished processing data or if an error occured.