Sending data over wifi w/o a website

meow-

i have many little esp32 guys with the built-in wifi.
many will be remote targets for nerf and whatnot.
they get a piezo and some leds.
one guy gets to host a game.
he sends out the game mode.
the others report as dictated by a given game mode.

clearly i do not do this sort of thing often.
i can handle the basic logic.
i am having a hard time with the wifi aspect.
setting up a web server seems the best way yet hosting the site involves c++ from arduino but also html and css.
i know some c++.
that's it.

is there a way to use wifi to just send data without involving a website?
or, better even, is there something else i should be doing to accomplish my goals?

thank you for any assistance!

I'm sure there is. You can use a WiFi terminal on your phone. I imagine you can have something similar on a PC but I have never actually heard of one.

One way is UDP. I haven’t used it on an Arduino but I’m sure there’s a library.

for ESP32 UDP have a look at File>Examples>WiFi>WiFiUDPClient
you would have to write a UDP server for the PC, e.g. in C++, C#, Java, etc
also consider TCP - look at File>Examples>WiFi>
or use MQTT, e.g. esp32-mqtt-publish-subscribe-arduino

do you wish to transmit data continuously or in blocks???
what do you wish to do with the data once it is on the PC?

yes.

you can use TCP (without HTTP) or UDP.

I have used Processing as a web server to receive data/commands from an esp project, this may be of interest/use?

Thank you for all the replies.

I will look into UDP and TCP.
Processing as well. I like that little script.

Bit more information for anyone still playing:
The goal is a target system for nerf and whatnot.
I picked up a handful of the xiao esp32-c3 boards.
I intend to add a piezo as a knock sensor.
Also add some rgb leds to indicate mode.
These will do some basic processing on a hit and report in.
The main board takes all the reports and tallies.
Also sets the game mode and anything else needed.

So far as I can work out I need my main board setup as a server.
That one hosts a page to which anyone else on the network can report.
The targets need to be setup as clients. (I think)
All of this will be on its own, dedicated, router.

That is the original plan.

All I really need is the burst of data from when a target takes a hit.
So, a quick connection from one of dozens of targets to a single head unit.
Doing that without hosting anything seems more direct.

That said, server offers one access to monitor the game via cell phone..

Anywho, enough rambling for this day.

update:
TCP is, indeed, exactly what I was looking for.
my targets can report to my central command.
my central command can update my targets.
very cool.

now i need only implement...

thank you for your help folks.

quick question:

as i read it, once connected, i can treat my little wifi object as a serial connection.
open a connection.
write over some data.
shut it down.
this is way easier than I had though.

you guys are great!
quiet bunch, but still great.

is that preferred to simply typing out a thank you as i had done?
i certainly appreciate all the assistance.
quiet isn't bad.
reality isn't bad.
things simply are.

Maybe also look at ESP-NOW for simple communication between peers. Getting Started with ESP-NOW (ESP8266 NodeMCU with Arduino IDE) | Random Nerd Tutorials.

1 Like

looking, briefly, into that esp-now.
seems they have a limited number of potential connects.
the end goal for my project is dozens of targets.
i believe wifi will cover what i am after here.
thank you for the suggetion!
that guy has some great demos.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.