Sending Data Via WIFI

I am instrumenting a Bee Hive to remotely monitor Temperature, Humitidy, weight and sound volume. I want to incorporate a SEEED XIAO as the primary data collection MCU. Basic code for reading the sensors is straight forward as is sending and receiving data via the serial port. However, I want to be able to send data via the wifi instead of the serial ports. I will be using a Raspberry PI to collect and organize the data. It will also server as the local Access Point for the XIAO and other devices in the colony.
Connecting the XIAO to the network is pretty straight forward and I have found at least one article on using the seeed as a web server to publish a web page with the data, but I want to be able to send a trigger to the XIAO and have the XIAO send the data to the client.
So my question is can anyone point me in the right direction to find a way to send data via wifi to a raspberry pi.
Many thanks.

Hi there, and welcome Here.
So looks like a fun project. Is it just one set of Hive boxes or more locations? if so you may want to consider , Lorawan instead of Wifi if the distances are great. the Xiao version with the lora sandwich board with external antenna may be the way to go. 3D print an enclosure that works with your sensor connections and Xiao can handle all the RF tasks EASY!

Check out the other threads on Point to point lora and mesh if the distances ar smaller.
HTH
GL :slight_smile: PJ :v:

you can do a one to many star configuration or Master/ Slaves topology. :+1:

Many thanks, that may be the answer I have been looking for. Right now just one box, however that could expand to many all pretty much centrally located. But scattered site comm now does seem to be a possibility. I did some research on LoRa and it definately holds promise. I have found several “add on” devices for Arduino, but so far nothing for my Seeed ESP32. I really like these tiny MCUs and they perfectly fit the project I am working on. But if I can’t find an addon then maybe I’ll use wifi for my local data collection using the ESP32s then transmitting to a Raspberry Pi with a LoRa hat for “burst” transmission of the data to a server on demand from the server. I think I might be able to work that with a Class A network for longer battery life. Lots of design work needs to be done before I put anything on a bread board, but that’s the fun.
Again, thanks for the insight into LoRa.

Hi there,
Well then LOL, Have a LQQK here

This little nugget of joy will fit the bill and is easy to work with :v: everything is right there…
Some great threads on Point to Point (P2P) on here so check those and you will be (P2MP) MULTI-Point in no time!
HTH
GL :slight_smile: PJ :+1:

If you want Cadillac instead of mustang : go here Plug THAT into THIS

Economy class , toyota like go here:


You can trim it down(break some off) to get into the COMPACT :grin: class
Too GL :vulcan_salute:

Many thanks, Just ordered the S3 package. Unfortunately on backorder.

1 Like

OK, LoRa will solve the long distance communication issue, however I still want to use wifi to communicate between the XIAO and a Raspberry pi which will gather data and send via Lora. So I need to find some information on how to set up a client server using XIAO and its native wifi. Basically Client requests temp and humidity and the server sends it. Most of the examples I have found are all set up as a Web Server, but I don’t need that, just a way to use wifi instead of a serial port. I would think it would be the same as sending data over any network connection. But in all my years in IT I never really did that. Always used SSH to transfer files, never to send and receive individual data bytes. Thanks and any help always appreciated.

Hi there,

So I have used this method in the past and it works well.

Use Sockets to send and receive data over TCP

Basically you create an endpoint and use sockets to exchange data to an IP and Port(socket).
HTH
GL :slight_smile: PJ :v:

fyi, You can make TCP Server or UDP server too. or
Set up an access point
Use the beginAP() function to create an access point without a local WiFi network. The default address for the board in AP mode is 192.168.4.1.

Exactly what I was thinking. I run Ubuntu and can use Python to code up the socket from the linux side, just wondering what libraries I would need for the XIAO side.