How to start ? my first time to use the kit and Wifi modules

Hello, I’m embedded software developer, I mainly worked in writing drivers from scratch and I am very well familiar with embedded C. I have to build Wifi mesh now and I am using Proton. I’ve no knowledge at all how Wifi works or how does this module work. I am not familiar with Arduino tho because I can see it’s similar. so please tell me how to start to achieve my goal. thanks

That depends on your goal.
Can you elaborate what sort of WiFi mesh setup you intend to build?

If you want to go for mesh without limiting yourself to IEEE 802.11, you may want to start off with the Photon (not Proton) to familiarise yourself with the “language” (Wiring, Arduino, C++) but wait for the Argon which will have dedicated mesh hardware to actually build the mesh.

Yea actually I meant Photon sorry for this mistake.
So my project is to build a Wifi mesh to connect multiple nodes to each other and then to connect then to the internet. far nodes will send data to the closer nodes to the gateway in case signals didn’t reach them and they will send data to the cloud.
each node should be able to have ADC or Modbus (UART based) interface to obtain data.

OK, but I’m still not sure whether you actually must use IEEE 802.11 or could also accept the mesh to be based on IEEE 802.15.4 which the next generation of Particle devices will support out the box.

The Photon does (currently) not support two independent WiFi networks concurrently.

first I want to build prototype with 2 nodes. 1st node will get data and send it to the 2nd node, and the 2nd node will send its own data + the data of the 1st node to the internet through access point (router). I’m newbie in IOT so I don’t know the difference between those 2 standards. but now I’ve to build a simple prototype.

(Moved from “spin-off” thread back to original topic)


Hi, so I’ve 2 Particle Wi-Fi modules. I want to send data (any variable) from the 1st one to the 2nd one. then I want to post the data from the 2nd one (2nd one acting as a gate way) to the cloud.
I still don’t understand the way how to make 2 modules communicate directly ?

Opening a new thread just because you didn’t like the answer provided in the other thread isn’t best practice IMHO.

1 Like

Since both Photons will have an IP address on your wireless network, is there any reason you couldn’t use the TCPServer/TCPClient code to send your data from one node to another? You should be able to use client.write() to send any arbitrary data. This is how you did it in the old days when you were writing BSD socket-based C code.

That’s the reason why I opposed the opening of a new thread for the same question

And hence I’m going to close the “spin-off” topic and attache the posts to the original thread.

1 Like

What do you mean by 2 wifi networks concurrently? I want to make 1 Wi-Fi mesh network not 2. and I want some of the modules to act as nodes as I explained. I think it’s considered as 1 network right? sorry if my question is funny I’m still a newbie in IOT.

If you want one device to connect to the WiFi of another device the host device has to provide the network by acting as an access point, but when the same device should also connect to your WiFi router (or another “mesh relay station”) in order to communicate with the internet, it needs to be client to another network and hence you are dealing with two network connections on one device and that is what I meant with concurently.

A Photon can either act as AP or as network client but not both at the same time (as of now).

2 Likes

Okay now it makes sense. but what if I collect the data from the nodes (connected to first network) and then I pause receiving data for sometime and act as a gateway and send data to the cloud then change my mode to connect to the 1st network again?

2nd question will the TCPServer/client solve the issue as @syrinxtech mentioned above?

I will explain in details how do I want the mesh network to behave.

some nodes are acquiring data from sensors or modbus connected to devices. those far nodes can’t reach the router actually. so they will send the data to the closer nodes and those nodes will send data to the router by its turn. I think TCP requires that all nodes have direct access to the router right?

Have you considered one gateway device, and then a cheap radio to connect simpler microcontrollers? The nRF24L01+ and an Arduinno pro mini should make for simple nodes that don’t require internet access.

Alternatively, wait until the Gen3 devices are released, which are made especially for Mesh.

My network is supposed to be highly secured and also I’ve a distance range I want to stick to. I was thinking to use BLE’s with cheap STM MCU but then I figured more distance may be required and the security level of BLE is not pleasing.

Also what about softAP? hopefully u will remember my previous questions too

You don’t really want to permanently switch back and forth between SoftAP and Client mode.

Also when you say …

… you would need to know how to perform data encryption in your code since the Particel crypto features are only available for cloud communication and not for SoftAP, TCPClient, TCPServer, UDP objects and libraries based upon them withouth additional crypto layers.

You seem to be trying to use a hammer where a spanner would be the better tool :wink:

1 Like

Got it! but may I know the disadvantages of switching back and forth between SoftAP and Client mode?

Or add an RF95 radio to the Photon. Use the RadioHead libraries which provides full mesh support. Check this Community board and you’ll find lots of info on the RF95 radios.

Isn’t it obvious? What would you suspect to be the disadvantage of permanently switching off and on and off and on your home WiFi AP? Or even worse (but more comparable) a WiFi extender.
All connected devices would lose connection and will start scanning for alternative networks, once the network comes back the clients have to negotiate a new connection just to lose it again the next moment - rinse - repeat.
For a WiFi extender you would even add an extra layer of difficulty. Once you switch it on, it first needs to connect to its home router (which will take time), then activate its own host network and now wait for for client devices to engage in connection (which again will take time).

2 Likes