Jay2101
Posts: 4
Joined: Thu Apr 02, 2020 6:28 pm

WiFi: 2.4g vs 5g Confusion.

Thu Apr 02, 2020 7:22 pm

Hi All,

TLDR: I'm getting conflicting info on whether I'm connected to 2.4g or 5g wifi.

Recently bought a Pi 4B. For a specific project I need it to use 2.4g wifi (more on the project at the end if anyone is interested).

The Pi is going to control a WIFi smart bulb over local LAN. The Pi and the bulb need to be on the same network. The bulb can only be on 2.4g. I've got it fully working on my Linux Mint laptop that only uses 2.4g.

My router combines the 2.4g and 5g into one network. Using the Rapbian GUI I go to the wifi icon and it tells me I'm connected to my network and there is a red "5G" icon on the same line. Cool, I'm on 5G.

When I run Wavemon it tells me:
freq: 2462 MHz, channel: 11 (width: 20 MHz)
I'm assuming this means I'm on 2.4g. This is the same output I see running the same command on my 2.4g-only Linux laptop.

Both can't be true (I think?). I would reconfigure my router, but under the current lockdown I don't want to mess with it as I need the internet to work from home. I would also usually visit my parents who have a split 2.4g/5g network. I also can't do this at the moment.

Any advice?

Thanks,
James

The Project: Scrape data to get numbers of coronavirus cases once per day. Depending on the values compared with the previous day the bulb will light up to indicate an increase or decrease in numbers.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5590
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: WiFi: 2.4g vs 5g Confusion.

Thu Apr 02, 2020 8:18 pm

Does your router use the same SSID name for both 2.4GHz and 5GHz? That was the case for my (IP provided) router until I changed things so that "-5G" was appended to the SSID for 5GHz channels. (Whilst you're wary of changing any router settings that sort of change is minimal and easily reversed).
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

JustSumDad
Posts: 5
Joined: Thu Apr 02, 2020 8:28 pm

Re: WiFi: 2.4g vs 5g Confusion.

Thu Apr 02, 2020 10:53 pm

Unless your router was setup special to separate the 2.4 and 5g networks they are both on the same subnet.

That is to say, devices on the 2.4g connection to the network should have no problem talking to devices connected to the same network via 5G.

This statement I made is assuming a few things tho, like device isolation is not on and things like that. As I said tho, these are special configurations that normal home setups almost never use.

User avatar
bensimmo
Posts: 4577
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: WiFi: 2.4g vs 5g Confusion.

Fri Apr 03, 2020 6:35 am

As above, I wouldn't worry (what router is it).
I have band-steering enabled on all of mine, it's much nicer and easier, especially for portable devices. The devices just move you between them as needed/is better.


Anyway, you shouldn't need to be on the same frequency. All mine can talk to each other. (Technicolour WiFi Router and also TP-Link Powerline WiFi extender, models if needed)

Type
iwconfig
At the commend line.
It'll tell you there

e.g.

Code: Select all

pi@raspberrypi4:~ $ iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11  ESSID:"BlueCow"
          Mode:Managed  Frequency:5.54 GHz  Access Point: E2:B9:E5:A1:34:87  
          Bit Rate=60 Mb/s   Tx-Power=31 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=44/70  Signal level=-66 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:5733  Invalid misc:0   Missed beacon:0

eth0      no wireless extensions.

pi@raspberrypi4:~ $

Jay2101
Posts: 4
Joined: Thu Apr 02, 2020 6:28 pm

Re: WiFi: 2.4g vs 5g Confusion.

Fri Apr 03, 2020 1:59 pm

Thanks for the replies everyone!

It seems I've had a terrible misunderstanding of what's happening.

Those saying that devices on the 2.4 and 5 networks can talk to each other are correct. I've logged on to the router today and forced my laptop onto 2.4g and the script still doesn't find the bulb.

Logged on to my Linux laptop and it seems to have logged on to 5g (I was wrong, it supports both apparently!) and the script works.

So it looks as though I don't need to split the network in two. It also means there's something else happening, which is... sort of exciting.

I'll get to work and see what's happening.

Thanks for the advice!

I'll be sure to report back when I sort it.

User avatar
bensimmo
Posts: 4577
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: WiFi: 2.4g vs 5g Confusion.

Fri Apr 03, 2020 3:47 pm

What's the smart bulb ? Are you using Tasmota or similar firmware on it ?

If you can see it on your laptop, grab the IP of the device and then go to the pi and 'ping' that device from it.

Jay2101
Posts: 4
Joined: Thu Apr 02, 2020 6:28 pm

Re: WiFi: 2.4g vs 5g Confusion.

Sat Apr 04, 2020 1:01 pm

The specific bulb I'm using is a YeeLight bulb because they have a relatively open API to control the bulb on your local network.

I've managed to log on to my router and detect the IP address of the bulb and I can ping it on all laptops/Pi's.

https://www.yeelight.com/download/Yeeli ... n_Spec.pdf

I've checked the documentation and the generated search request appears to be correct.

The documentation states that the response from the bulb is sent back via the same port/address as the request/search from the third party device (my laptop, the device making the request).

I'm now wondering if the port that sends the response isn't set up to listen for incoming responses. e.g. search request sent from 123.345.6.7:1212 doesn't listen for a response. I've tried turning off all firewalls etc. with no luck. I'm slightly out of my depth with ports and network things, but now isn't the worst time to learn. I'm currently really struggling to see which port is used to send the request or if that is even a sensible question to ask.

Any ideas I can try please let me know!

Jay2101
Posts: 4
Joined: Thu Apr 02, 2020 6:28 pm

Re: WiFi: 2.4g vs 5g Confusion.

Sun Apr 05, 2020 7:28 pm

I found the problem: there was an error in the perl module I used with a specific version of Perl.

Perl: v5.28.1

Module: IO::Socket::Multicast

Link to bug: https://rt.cpan.org/Public/Bug/Display.html?id=130581

I used tcp dump on my Linux laptop and Pi. I could see the initial search request being sent on the laptop, but not on the Pi.

Further messing around with the scripts revealed an error with a function called: mcast_send. Example usage:

$socket->mcast_send( $query, "$self->{address}:$self->{port}" )

I had to alter the Multicast.pm file. I suppose I could have switched to an earlier version of Perl as a solution. It works fine with v5.26.1.

Thanks for all the help and advice!

Return to “Beginners”