Connect Arduino to the Internet without the shield - c

I am doing some projects with Arduino at the moment, and I was wondering if it is possible to make HTTP requests without the Internet shield.
The idea was to make a program which does HTTP requests and sends the response to the Arduino over the serial port.
I did some search online, but I could not find a way how to send the response to the Arduino board.

Yep, I've done this. I had a remote temperature logger built with an Arduino. Then I used the USB cable to connect the Arduino to a laptop. The laptop had a WiFi connection to my network and could get out to the Internet if it wanted to, but I actually just connected to my desktop.
I didn't do anything special on the Arduino other than writing to/reading from the Serial port. I had a tiny Python program on the laptop acting as a gateway to the network (read from Serial, write to port and vice versa) and another tiny Python program on my desktop to read from port and write to disk.

it is possible also to use pyfirmata in a python web server like flask under linux to control your arduino via web interface.your arduino will commnunicate with your web server via firmata protocol

Related

Connecting to LEGO Spike using LEGO wireless protocol

I wanted to make a connection to LEGO Spike prime hub using LEGO wireless protocol through bluetooth.
I tried to run examples from github using c or go but its failed. I couldn't force Linux to receive frames. I tried to use go bluetooth package but still a message that profile is note available. The only way I could connect to Spike was rfcomm but I cant receive LEGO wireless protocol frames this way. Do you have aby suggestions what I should do?
Regards
Jack

connection between windows and Linux sockets in c

I am using the socket module in python to send commands to my raspberry pi to turn GPIO pins on and of.
I am switching to C, where I will use winsock.h and winsock2.h to create the server on my PC and sys/socket.h to create a client on the raspberry pi.
Is it possible to establish a connection between these two different libraries?
I only want to create a socket, bind, send and recv. No other operations.
I recommend you to check this documentation, there are some examples for a Windows Server / Client connection:
https://learn.microsoft.com/en-us/windows/win32/winsock/getting-started-with-winsock
For Linux you need to do some adaptations as you might know or you have already implemented, I did the same for 2 desktop applications to send data from a Linux PC (client) to a Windows PC (server). As mentioned in the comments it doesn't matter the devices while they are in the same network and follow the TCP/IP protocol.
I was able to do this even connected through a VPN. Unfortunatelly I can not share the code. But I developed this communication based on the documentation from the link above.
I hope it helps. Actually if you want to use Python in the raspberry Pi there is also a python built-in package that you could use: https://docs.python.org/3/library/socket.html
And you can use the code from the link above in Windows. It should be straighforward.

How to send the same files to multiple devices using wifi

i have a webserver application using PHP, this application have to send 200MB of data to every device connected to the local network using wifi (Devices are a minimum of 100 to 300). I can send it using a ZIP file (200MB) or sending every single file (from 1 to 10 MB for each file).
Actually i have used TCP protocol on a very good hardware and all works very good! but now, i have to send it using a raspberry Pi 2..
what is the best protocol to do it? I can use a multicast approach? someone know the best way for do it on a raspBerry? I need this operation takes a very short time ;)
ps: For wifi network i have a very good antenna and i can link my raspeberry to the router using cable.

tftp server client example for lpc1768

I am trying to work a TFTP client for transferring files in MMC/SD card to PC through Ethernet on LPC1768 controller. For TFTP, it needs two ports to be connected to TFTP server.
I am using TCP/IP stack which comes with LPC1768 webserver example. Is it possible to open two ports at a time.. I tried but its not working.
Is there any sample program or tutorial for TFTP client for microcontrollers which can work without OS?
or any alternative protocols?

listening to communication between a local application and a device

I have a windows application on my PC which connects to a device over telnet. It sends a series of commands to the device, and the device responds to it.
Is there any way I can listen to what that program is writing to the device?
I tried using win32 socket programming to create a client that connects to the application. But, I get an error saying connection refused. When I analyze the traffic between the application and device on wireshark, I can see that the application uses different ports each time it reads from or writes to the telnet port(23) of the device.
Is there any way I can read the commands sent by the program to the device?
If you want to capture program's output to the device
programmatically, the right way is not to connect to the program (you
can't tap into an existing connection), but instead provide a server
that will stand for target device from the program's point of view.
It's going to work if the program can be configured to connect to the
device at different address and port. Write a "proxy" that listens on
some fixed port, and for any accepted connection, opens a client
connection to the real device. Then it should forward data in both
directions between the accepted connection from the program and the
client connection to the device. During this, you can also parse data
or do whatever you want with them, e.g. forward them to yet another
connection to another real device.

Resources