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?
Related
Newbie in the community, here. First of all, thanks for all the help in all these years i've been working on embedded development :D
I have a problem with an Atmel AT91RM9200 ARM microprocessor, connected via RMII to a Mikrel KSZ8863 ethernet physical interface. The ARM is loaded with U-Boot 1.1.2, which loads the Linux Kernel v2.4.27.
I manually added the code to interface U-Boot with the KSZ.
The problem is:
Using U-Boot, if I try to download something from my TFTP server (located in the same network), the connection sometimes has so many timeouts that the download fails, and sometimes has just 2 or 3 timeouts.
I checked the U-Boot FAQ page, and the most probable reason for the timeouts is a wrong speed configuration, which I double checked.
What could be the reason for the unreliability of my connection?
Thanks,
Loranzp.
Setup a minimalist network consistent of TFTP server, client and Sniffer (Wireshark in promiscuous mode) (if you use a switch it must have a repeater port where to connect the sniffer PC)
Next run traffic captures and analyze when and how the timeouts occur.
Consider:
TFTP BlockSize too big leading to mishandled IP fragmentation.
Server provides the packets too fast after REQ or ACK
Not correctly handling block number roll-over (only when handling big files)
etc
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.
I am new to contiki os and i am trying out mqtt in contiki os. But i had problem connecting my mote in cooja simulator to my mosquitto server on my ubuntu desktop. So is it possible to do that? I am trying to use IPv4 for this and my example for mqtt come from https://github.com/esar/contiki-mqtt
Thank you
Yes, it is possible.
You need a RPL border router node with SLIP (Serial Line IP) enabled (I have never simulated physical Ethernet port in a node on Cooja).
In your RPL border router, open the "Serial Socket (Server)" and in the Linux console, run tunslip6 to connect the RPL tree into your local network.
This is a tutorial: http://anrg.usc.edu/contiki/index.php/RPL_Border_Router
After the tunslip6 is running, there's no difference from running the nodes physically, it's the same setup.
Now your nodes will be able to find your mosquitto server in the static IPv6 address you've configured. I remember to be using "aaaa::1". To be sure the network is up, ping6 your RPL border router.
ps: If it is a production application, you might not want to use MQTT. Nor TCP or packet segmentation scale well in the RPL, also MQTT can have fat payloads. Go UDP with CoAP or MQTT-SN.
I'm developing an TCP/IP stack that will run on another device connected by bluetooth.
But I want to test against an working Stack. My testing scenario would be:
MY DEVICE TCP/IP STACK --------------BLUETOOTH ----------------- WINDOWS/MAC TCP/IP Stack.
Anyone have any idea how could I write IP packets over an Bluetooth connection on Linux/Windows or mac ??
One way is you could establish a ppp connection between the device and the PC over bluetooth first. For this you will need support for ppp on the device side. Once you are able to dial-up and establish a ppp connection, tcp/ip can be run over ppp.
These links may be useful (although they are specific to linux):
http://www.daybefore.net/bluetooth_ppp.html
http://www.rpgameplace.de/blog/index.php?/archives/19-Networking-over-Bluetooth-using-BlueZPPP.html
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