Recent

Author Topic: how to (need idea)  (Read 856 times)

krolikbest

  • Sr. Member
  • ****
  • Posts: 250
how to (need idea)
« on: February 28, 2023, 08:13:00 pm »
Hi,

 i'm in the middle of building some sensors net. I've ten sensors (based on esp8266) around and they're communicating with RPi over TCP. On the RPi works my httpserver which keeps connection with these sensors. Let say this network has addressing 192.168.0.1 .... 10 (sensors[1..10]) and RPi sees them. This works (on my desk), I can read sensor's datas. However PRi and sensors work in range of my home router, so IP / wifi net name is hard coded in every sensor and RPi on the start first makes scan looking them through some address range in this wifi net name.  So far so good. However RPi should act also like AP (access point) in case there won't be any other wifi net (lack of router).  So if there is no ethernet (no router, no other AP etc) then RPi  provides own wifi net (of course sensors then would have hard coded this wifi net (name, passwd, IP etc). And there comes the question: is this possible to configure Raspberry Pi that it acts like router or AP and then there is no need to use other router?
Hope I messed it up only minimal describing my idea :)

Thaddy

  • Hero Member
  • *****
  • Posts: 16168
  • Censorship about opinions does not belong here.
Re: how to (need idea)
« Reply #1 on: February 28, 2023, 08:23:14 pm »
Yes that is possible, like with any cpu. A good example is PiHole which I run permanently on my home server (which is actually an array of RPi's )  PiHole runs a DNS server and that is basically what you need.
Study the code from PiHole (Python). It should be able to be translated to FreePascal, but I am not really interested in doing that.
If I smell bad code it usually is bad code and that includes my own code.

krolikbest

  • Sr. Member
  • ****
  • Posts: 250
Re: how to (need idea)
« Reply #2 on: February 28, 2023, 08:28:11 pm »
Meanwhile it seems I've found solution but have to read docs and then test. It's true, it can act like AP and bridge (if there is other router)... But if someone has it done already, I don't mind if shares hot to set it up on RPi :) ( I have RPi 3B+)

 

TinyPortal © 2005-2018