Iot project With Esp8266 and Pi3 through a Web Browser - nodemcu

I am trying to build a smart home.
I have some Esps to control the peripherals
And I want to use the raspberry Pi as the hub/webserver
The pi would host a website to allow the controls.
I am not sure how to put it all together.
The MCU lib can itself host html.
Any suggestions.

if raspbery pi and esp8266 run in LAN. Thats can communicate via TCP and UDP. UDP is boardcast protocol so it can be reach multiple esp8266 at the same time even if yo dont know ip address of esp8266s. But there is no response for security. TCP is unicast protocol. You have to know esp8266s ip address for using is. You can use UDP for take esp8266 ip address after then you can communate esp8266s via TCP.
if raspberry pi and esp8266 communicate via internet you can use MQTT.
i suggest you learn how create server by using raspberry pi (maybe apache or others) and develop scripts on raspberry pi for using TCP, UDP, MQTT. Also you should study to delevop program for esp8266s.

Related

access to relay boards via VPN

I have a few 'smart' relay boards on different sites. These boards have a ethernet connection and are running a built-in web server on TCP 8080. I can access them from the local network and control them via a browser.
To control these boards remotely, I could assign them a fixed local IP address, open TCP port 8080 on my router and forward it to that address. But this is a risky thing to do, off course.
And I would have to do this on the different routers (from different IPSs) on each site and keep track of all these public IP addresses. (Via a dyndns service. Most routers are not VPN-enabled, afaik.)
Is there a better way using VPN-tunnels? I already have a Linux VPS running for other purposes and could install a Raspberry Pi on each location. All these Raspi's could connect to my VPS. And I would no longer need the dyndns.
Maybe, I could also find a way to map the URLs for the different relay boards to a more human-friendly form. Like this: http://myvps.domain.com/site2/relayboard3
How can I achieve this? I could install OpenVPN on the VPS server and the Raspberry Pi's (one for each site). But how do I have to configure this? VPS in the role as VPN server and Raspi's as VPN clients?
(I assume the gateway address from the relay boards has to change to the local address from the Raspberry.)
And do I need a VPN client om my Android phone to be able to browse to the relay boards or not?
What do I need to forward the http connections to the correct relay board? A proxy server?

From WiFi to Cellular 3/4G on ESP32

I am building a project utilizing Wifi on the ESP32 module. Using RTOS, I am running a web server on 1 core and a web client on another core. This works very well and I can access the web server remotely via my browser and the WiFi provided IP address. The Web client reads some sensors and sends the data via WiFi to my database. All good and everything works as desired.
Now I need to do the next step and move beyond the reach of the WiFi and reproduce the same result via 3/4G cellular. I looked at the "easy" solution to use an industrial 3/4G WiFi router and simply keep what I have. Cost of these "industrial" type routers are on the high side, where as 3/4G module which also include a GPS chip are around half or less. Problem is that I cannot get my head around how I will "replace" my current WiFi functionality with one of these modules. The modules seems to expect you to connect via serial (rs232) and using modem AT commands establish a connection to the internet. Question is, after connecting to the internet, how do you continue to have "network functionality" same as with the built-in WiFi? Is there some library that will do ethernet over the serial port? Can I still have the WiFi and the "serial ethernet" running at the same time or switch between the two?
Thanks!

How to I set up Socat to relay data between rapberry pi and Windows using cygwin via ethernet

I have downloaded SoCat via Cygwin on my windows device and have downloaded it on my Raspberry Pi.
What commands should I be using to relay data between the two devices.
I don't want to relay any complicated data, I just want to be able to set up a connection via ethernet between the two devices for now.
Thanks.
(Not 100% sure what are you asking, but assuming the simplest case...)
Setup IP networking on the ethernet interfaces of both devices.
Ensure it works (e.g. ping <ipAddressPi> works from windows and ping <ipAddressWindows> works from the Raspberry Pi)
Run a simple TCP server on windows by using:
socat TCP4-LISTEN:12396 -
Run a simple TCP client on Raspberry Pi by using:
socat TCP4:<ipAddressWindows>:12396 -
You are done...everything you type on one side gets written on the other side

Read/Send sms from wifi modem in c#

I have modem which is work on browser as wifi and when i connect to pc it becomes virtual router having ip address and DHCP settings. Now i want to use this wifi dongle as like long code or sms gateway.Also this modem is working on browser so it dont have port for communication to pc. How i can do this i.e. take sms which is stored in device local memory not on cloud and send it to clients. I cant use AT commands for read/write sms coz AT commodes only work when we have port number...pls suggest if any idea...is it possible?? I want implement this feature asp.net MVC5
Thanks in advance

Is it possible to target a specific Arduino device with the CC3000 Wifi over the web?

I've got my CC3000 Wifi shield and Arduino Uno working as intended using the several libraries, including the aRest.h library. In order for me to control the Arduino from anywhere across the web, I configured the port-forwarding settings on the router to address the Arduino via the routers ip address.
My question is this: If I had a multiple Arduino modules/devices that relied on two way communication (client/server), how is the setup configuration automated for each device so that I could target a specific Arduino with regional data? I don't expect the end user to know how to access the router and configure port forwarding.
I hope this makes sense, I'm a newbie to the world of micro-controllers, but have had some success with progress as of late
You should be able to make a simple way to setup the Wifi, when this job is done you connect via socket so a socket server ( python,node,etc... ) and this will avoid any port-forwarding.
You will not need to care about all this messy tasks, you can have as many as you want arduino in the same network and access from the internet.

Resources