I want to send data from an arduino to a web page for remote monitoring as well as send data from the web page to arduino for remote control. Is it possible to create both a client and a server in the same Arduino? Also is there any method by which it is possible to control and monitor an Arduino at the same time?
Thanks
Yes, it is possible to have both a client and a server in the Arduino running at the same time. Your second question is not very clear.
Related
I'm trying to build a wireless robot using an ESP32 and ESP32 cam. My idea is to use the ESP32 to control wheels and other sensors, while ESP32-cam is attached on the robot and sends live video to the user via a website. At the moment, I have made two separate websites for the two boards and they work as expected. However, I want to somehow "integrate" these two websites into a single one so that I don't have to open 2 windows for each boards to monitor the robot.
I'm using this library: https://github.com/me-no-dev/ESPAsyncWebServer for the ESP32 website and following this tutorial: https://randomnerdtutorials.com/esp32-cam-video-streaming-web-server-camera-home-assistant/ for the ESP32-cam web server.
One solution I'm thinking of is to paste the link of the stream to the ESP32 web server. This could be the fastest way, but I'm not certain whether this is possible or not. Any suggestions would be great!
I'm new to Nodemcu and i need your recommendations.
I'm curently doing an IOT project that can be worked in the large area and I decide to use Nodemcu - ESP8266 to transfer the data. I plan to use 3 Nodemcu to demo. Two of them are used for collecting data from sensors and transfer them to the 3rd Nodemcu. The 3rd Nodemcu will act like a gateway and it will recongnize the data from each node and send it to the Web Server that I myself created. The Web has its own domain and hosting.
With the ideas above, i have some questions:
Do i really need the 3rd nodemcu to send data to Web Server? Or i just need to send the data directly from those 2 nodemcu to a Web Server?
If it's possible to use the 3rd nodemcu, so it should be worked in station or access point mode?
If 3rd nodemcu is not necessary, so how can i extend the working range of the project?
Thanks so much for your helps. I'm really appreciated. Sorry for my bad English too.
NODEMCU can be used to send data to the server directly if it connects with a router via WiFi(Router needs to be internet connected).
You don't need the third Nodemcu to transfer data. Both esp8266 is directly connected with a router to send data to the server. MQTT is the best protocol for sending data to the server from Sensor. NodeMCU works as an MQTT client to send data. You need to host MQTT broker on a cloud server. Server store data into the database.
If you want to use a third NodeMcu device. NodeMcu can support access point + station parallelly. An access point is used to get data from both devices. ESP8266 station is used to transfer data to the server.
All devices need to have into the same WiFi network to transfer data in between. In case of transferring data to the server, One solution is, To use WiFi range extender like Google WiFi.
You can use MQTTfx desktop application to send and receive data from NodeMcu(ESP8266).
MQTT library for ESP8266
https://github.com/Imroy/pubsubclient
Use the Following link to get more familiar with MQTT protocol
https://www.hivemq.com/blog/mqtt-essentials-part-1-introducing-mqtt
MQTT basic diagram
I am new to the arduino platform.
I want to use REST api for communication between my web server and GSM/GPRS.
i have already created a REST api for communication between my android app and web server, but now i want to fire the same REST api(GET request) using GSM/GPRS client in arduino and want to read the response from the server.
FYI i am using arduino uno for atmega328-pu.
I tried searching in the web but ultimately ended up getting nothing useful.
Any help will be highly appreciated.
Thanks in advance.
From what you write, it is not entirely clear if you want to use the Arduino as a REST client or server. For setting up a server on it, your best bet will be to use the Webduino library that implements GET and POST methods.
Depending on the type of networking hardware (Wifi, Ethernet) you are using, there will be an implementation of the "Client" interface that you can use for sending HTTP requests. See this example for the Ethernet client: http://arduino.cc/en/Tutorial/WebClient
The code for the GSM client is in the GSM library, that you can find here: http://arduino.cc/en/Reference/GSM
There's also a sample for using the GSM client: http://arduino.cc/en/Tutorial/GSMExamplesWebClient
Which GSM/GPRS shield are you using? If it supports the official GSM library you can use that or if it is a Seeedstudio GPRS Shield use my GSMGPRS_Shield. Anyway then use my fork of arduino-restclient or modify it if you use the default GSM library.
Let me know if that helps you. Otherwise I have some more examples etc I can post.
I would like to be able to develop an iPhone application that can communicate with Modbus devices, but I'm not sure how to proceed. Has anyone had experience with this or are there existing libraries out there for this purpose?
You will need first to know how to make a simple TCP client on your iPhone, and a simple TCP server on your computer that your iPhone client will talk to via WiFi. Make sure PING command works and firewall does not block your server port before any client/server experiments, and make sure that server port for experimenting is greater then 1024 and not already used. Then take a look at MODBUS TCP specification from official site, get familiar with function codes you are interested in, and study C code found here. Then make a simple MODBUS TCP client that can send a request to MODBUS TCP server and interprete an answer. The best way is to start reading single register value, then progress in time and add more functions.
I do exactly all above points, my iOS Modbus lib works fine, application is now up on AppStore, PLCLink read and set any modBus data into my Wago home automation.
Installation guide : http://pautex.fr/plclink
Background
There are a lot of App Store released iPhone apps that require an IP based server on the desktop so that the iPhone can connect to the desktop as a client. For example, there are many programs that emulate a keyboard, touchpad, or Apple remote on the iPhone so that a desktop computer can be controlled over wifi. However, many of these applications get around writing their own server by requiring the user to install some VNC server variant.
Question
What is the best way to implement a secure (encrypted) IP server on a desktop (Mac and Windows platforms) that allows for simple two way message passing between itself and an iPhone client on a wifi network?
Sample Use Case
An event on the desktop causes the desktop to push a small image or text to the iPhone. An event on the iPhone causes a short text message to be pushed to the desktop. Any single event can happen at any time (doesn't appear synchronized to the user).
1st Follow-Up Question
Would this type of project be best handled using something like XML or JSON over HTTP? Or is there a better protocol, like BEEP or Bonjour(XMPP)?
What is the best way to implement a secure (encrypted) IP server on a desktop (Mac and Windows platforms) that allows for simple two way message passing between itself and an iPhone client on a wifi network?
Not sure if there is a "best" way, but much code is already available to do xyz-over-HTTPS (TLS/SSL). In that case, the "xyz" can be any web-based message exchange protocol, such as XML, JSON, etc. via REST or SOAP, etc.
If you want to be able to push events to a non-jailbroken iPhone you can't do it other than via Apple's Push Server which causes a notification to the client program if it is running or otherwise displays an alert of some kind to the user.
Typical architecture has those notifications handled by the client program as an indication it should go and get some data from the server - Apple insist we do not regard the notifications as trusted delivery.
I suggest a read of this article on using Bonjour and local networking, whilst it's iPhone to iPhone it should apply to desktop OS/X also.