wpa_supplicant

Hello,

Is it okay to not have a displayed wlan0 and know it and then use it for WiFi?

I am using wpa_supplicant on an older model of an image. It seems that I am not connecting due to it not being broadcasted for wlan0.

Seth

P.S. If there are ways to use wpa_supplicant to get around this effort, I will be researching this idea soon, please do tell me. If you know and can cut down on my searching online, please do let me know.

Update

Nothing…I tried some articles on the subject, some (5) and (8) ideas and even wpa_cli ideas too. It seems one must have a broadcast to get a WiFi connection…

are you referring to a non broadcast ssid ??

1 Like

Hey and Yeppers,

My SSID does not broadcast b/c I told it not to broadcast.

Seth

1 Like

Been a while since i played with that, but
all ya have to do is add
scan_ssid=1
to the network{} group in wpa_supplicant.config file

1 Like

@amf99 ,

I tried that too. It seems nothing is working as of now.

Seth

can you post your wpa supplicant config and which image (or uname -a) your using?
is this on a beaglebone black?
if you run,
sudo iw wlan0 scan | grep SSID
do you see your ssid, this requires scan_ssid=1 in your wpa config file

Sure,

@amf99 , I will get to it later today. Sorry for the inconvenience.

Seth

@amf99 : Here are some of the ideas around the kernel and image I am running along w/ the .conf file.

5.10.168-ti-r72

...

BeagleBoard.org Debian Bullseye IoT Image 2023-01-02

ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
update_config=1
#country=US

network={
        ssid="No Broadcast SSID"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="Password for No Broadcast SSID"
}

If you need additional info or some extra data, please let me know.

Hmm…

@amf99 , I performed and commanded the ip a command today w/out changing anything…

it works!

Seth

P.S. I have done nothing extra or even completed another command but it just works now…`

The reason I was attempting to install and update was b/c of a Facial Recognition cam I am using via i2c.

See here below for the source for this specific cam:

# Example of accessing the Person Sensor from Useful Sensors on a Pi using
# Python. See https://usfl.ink/ps_dev for the full developer guide.

import io
import fcntl
import struct
import time

# The person sensor has the I2C ID of hex 62, or decimal 98.
PERSON_SENSOR_I2C_ADDRESS = 0x62

# We will be reading raw bytes over I2C, and we'll need to decode them into
# data structures. These strings define the format used for the decoding, and
# are derived from the layouts defined in the developer guide.
PERSON_SENSOR_I2C_HEADER_FORMAT = "BBH"
PERSON_SENSOR_I2C_HEADER_BYTE_COUNT = struct.calcsize(
    PERSON_SENSOR_I2C_HEADER_FORMAT)

PERSON_SENSOR_FACE_FORMAT = "BBBBBBbB"
PERSON_SENSOR_FACE_BYTE_COUNT = struct.calcsize(PERSON_SENSOR_FACE_FORMAT)

PERSON_SENSOR_FACE_MAX = 4
PERSON_SENSOR_RESULT_FORMAT = PERSON_SENSOR_I2C_HEADER_FORMAT + \
    "B" + PERSON_SENSOR_FACE_FORMAT * PERSON_SENSOR_FACE_MAX + "H"
PERSON_SENSOR_RESULT_BYTE_COUNT = struct.calcsize(PERSON_SENSOR_RESULT_FORMAT)

# I2C channel 1 is connected to the GPIO pins
I2C_CHANNEL = 1
I2C_PERIPHERAL = 0x703

# How long to pause between sensor polls.
PERSON_SENSOR_DELAY = 0.2

i2c_handle = io.open("/dev/i2c-" + str(I2C_CHANNEL), "rb", buffering=0)
fcntl.ioctl(i2c_handle, I2C_PERIPHERAL, PERSON_SENSOR_I2C_ADDRESS)

while True:
    try:
        read_bytes = i2c_handle.read(PERSON_SENSOR_RESULT_BYTE_COUNT)
    except OSError as error:
        print("No person sensor data found")
        print(error)
        time.sleep(PERSON_SENSOR_DELAY)
        continue
    offset = 0
    (pad1, pad2, payload_bytes) = struct.unpack_from(
        PERSON_SENSOR_I2C_HEADER_FORMAT, read_bytes, offset)
    offset = offset + PERSON_SENSOR_I2C_HEADER_BYTE_COUNT

    (num_faces) = struct.unpack_from("B", read_bytes, offset)
    num_faces = int(num_faces[0])
    offset = offset + 1

    faces = []
    for i in range(num_faces):
        (box_confidence, box_left, box_top, box_right, box_bottom, id_confidence, id,
         is_facing) = struct.unpack_from(PERSON_SENSOR_FACE_FORMAT, read_bytes, offset)
        offset = offset + PERSON_SENSOR_FACE_BYTE_COUNT
        face = {
            "box_confidence": box_confidence,
            "box_left": box_left,
            "box_top": box_top,
            "box_right": box_right,
            "box_bottom": box_bottom,
            "id_confidence": id_confidence,
            "id": id,
            "is_facing": is_facing,
        }
        faces.append(face)
    checksum = struct.unpack_from("H", read_bytes, offset)
    print(num_faces, faces)
    time.sleep(PERSON_SENSOR_DELAY)

It is a camera from useful sensors. They have a github and some ideas revolving around their cam (sort of)…

1 Like

that’s great to hear,
what i have noticed, is that clients take longer to connect to an AP without a broadcast ssid. maybe this has something to do with your issues.

1 Like

Do you need to use only wpa_supplicant? I recommend using Network-Manager.
In my case, I found “nmcli” to be more usable than “wpa”.

1 Like

Maybe…

I was thinking that my dev. desktop was having issues at first. It froze today and blah, blah, blah.

But like I said earlier, the ip a command showed an IP today for the BBBW w/out any altering or changing of the .conf.

It has been a couple, exactly two, days since I signed on to the BBBW and since then, like stated, it just started to work.

Seth

P.S. The camera fell apart one day and stopped producing the connection from the BBBW i2c peripheral to the chip onboard the cam. Bad soldering job on the mfg. part. That or someone broke it before I got to the camera to build on the source…

I will keep in mind about the longer to connect idea for clients/targets when attempting to use NO broadcast IP addressing.

No @ALEX_PARK ,

I do not need to use it. I can use whatever is available that seems to work in general. I am going to update and upgrade w/ a Bookworm image soon.

I want to test this source and cam w/ an updated image for exposure to the data structure ideas in Python and for computer vision w/ this specific cam.

Seth

I don’t 100% understand your intent, but I similarly used nmcli over wpa_supplicant in my code to control wifi using pyqt.

Of course, it was also easier to use a non-broadcasting SSID.

While wpa is easier for the client to access the AP, I was more comfortable with network-manager for more user control.

If wlan0 doesn’t work, try NetworkManager as well.

1 Like