Autorun script on RPi 0 2

January 20, 2025, 07:51

thedeha420

I have a problem with an auto-start script. I’m using an RPi Zero 2 with a 64-bit Bookworm OS (no desktop). I’ve also installed a working Kismet, and this is where the issues begin. Since it’s a version without a desktop environment, I’d like Kismet to start automatically when the Raspberry is powered on (so I can access Kismet via my phone’s browser). Unfortunately, I have zero skills in writing scripts, and I just need a simple “sudo Kismet” to run at system startup. ChatGPT guided me in a way that eventually even Kismet stopped working. I reinstalled the system, reinstalled Kismet, and I’m trying to keep fighting with it. How to start with it?

k9t33n

Run crontab -e

k9t33n

Then select nano

k9t33n

That might need sudo tell me if there's an error

k9t33n

Then at the bottom you should be able to just add in
 
@reboot sudo Kismet

thedeha420

like this?

thedeha420

I don't got it

thedeha420

The whole idea of the project is to have access to Kismet from my phone after startup, outside of my home network, but I have no idea how to configure it. Besides that, I'll also need to configure Raspberry Pi as a hotspot later.

k9t33n

Correct yeah

thedeha420

Not working

k9t33n

Crontab is what you can use to automatically run scripts, what I told you to do should run your kismet command upon a boot

k9t33n

Check sudo Kismet actually works outside of crontab

k9t33n

I have a feeling it's just sudo kismet

thedeha420

Damn bro, thanks a lot!

thedeha420

that works!

k9t33n

Okay cool

thedeha420

Would you be willing to help me set up the connection as well? Not necessarily a hotspot. I'm open to any suggestions because I don't know where to start. Right now, when my Raspberry Pi and I are on the same network (my home Wi-Fi), I can always access Kismet through http://hostname.local:2501. However, when I leave home, I won’t be able to view it, for example, through a browser on my phone. How can I make this work?

k9t33n

You could connect to your phones hotspot

k9t33n

Or some people directly connect their pi via usb C to their laptop for portability, you may be able to do this with your phone idk

thedeha420

I dont want laptop connection. I did something similar on the occasion of PWN. But step by step from some tutorial. Should I just add the remembered networks in Raspberry? Extend the entry with the name of your hotspot and password?

k9t33n

Yeah that would work

k9t33n

Although hotspots can be unreliable

thedeha420

Why?

thedeha420

so what should I use for monitoring Kismet?

k9t33n

Your phones just isn't as strong and your pi isn't as good at WiFi in general so its not a good combination

thedeha420

okay, now its clear 😄

k9t33n

For a phone a hotspot seems like you only option because im not sure if using something like a ethernet to usb c/lighting or whatever adapter

thedeha420

so, for hotspot 'sudo nano /etc/wpa_supplicant/wpa_supplicant.conf' and just add hotspot id and pass?

thedeha420

as a normal network

k9t33n

Looks good to me

thedeha420

btw how do you write commands here on discord in such a cool frame? 😅

k9t33n

With the character `

thedeha420

test

thedeha420

thanks for everything

k9t33n

Text surrounded by just one \ like so \text\ looks like text And \
Like so 
\
Text \
Looks like so 
Text

k9t33n

No problem

thedeha420

doesnt work 😦

thedeha420


thedeha420


k9t33n

i can't read that launguage unfortunately

thedeha420

there is nothing important, just for show my hotspot is on and ssid name is correct

k9t33n

okay

k9t33n

to be honest i just don't have experience in hotspots with a pi and i usually like to have experience before i start guessing with people

k9t33n

so ill come back later and if no one else has had a crack at it with ya then i will attempt

thedeha420

ofcourse bro

k9t33n

thanks, you dont often get respect like that here yk

k9t33n

really makes the difference thank you.

thedeha420

You have already helped me like hell. I can only thank you and I take my first steps

thedeha420

about RPi, It is strange that I am connected locally by SSH. It should connect the same with the hotspot, because they are theoretically saved in the same file.

k9t33n

yeah but wpa supplicant is weird

thedeha420

and I wonder if this path is correct

k9t33n

i think it is yeah

thedeha420

/etc/wpa_supplicant/wpa_supplicant.conf

k9t33n

oh yeah

thedeha420

there is no way for a other localisation of networks id?

k9t33n

was the file already there without you having to create one?

k9t33n

mine didnt have it and im wondering it thats because ive never connected to wifi on that pi, if its a pi 5 thing or whatever

k9t33n

been trying to figure that out for a while

thedeha420

its RPi zero 2

k9t33n

yeah

thedeha420

damn, file was empty

k9t33n

oop

k9t33n

then its probably not the correct path no

thedeha420

haha 😄

k9t33n

i think it may be an old thing then

thedeha420

I forgot, that i wrote all my 3 networks

thedeha420


thedeha420

I wrote it, the file was empty. my mistake, forgot

k9t33n

me knowing the password probably wont do anything btw

thedeha420

hahahahahha, bro I'm amateur

k9t33n

no very easy mistake to make

k9t33n

generally your doing quite good right now

thedeha420

Every day I learn something new

oops.se

If your using Bookworm, start using nmcli, see https://discord.com/channels/818384379197784084/1193815086511435827

k9t33n

That's the one I was thinking off!

k9t33n

I forgot the command 😂

thedeha420

I'll try, thanks guys

thedeha420


thedeha420

<@1071178789939331253> <@796000224690307072> told You guys, totally newbie

k9t33n

newbie?

k9t33n

wdym?

k9t33n

im still in school and learning

k9t33n

and although oops.se would say otherwise to me it seems he's learnt all there is to learn 🤣

thedeha420

<@1071178789939331253> do You know what am I doing wrong with cmcli ?

k9t33n

No clue like I said I don't know enough about WiFi from cli, you can try nmgui which I have a little bit more understanding of

thedeha420

lead the way, chief

k9t33n

If you run nmgui you can create a new connection

k9t33n

Then input the ssid in the top, and password. Not so sure where that will be in the gui but if you take some screenshots I may be able to highlight them for you

thedeha420

<@1071178789939331253> how to run nmgui? I can't find anything

k9t33n

That's the command it's self? If it isn't recognised I got the name wrong

k9t33n

I'll help more tmmr

thedeha420

Yep, unknown command. Thanks a lot. See u tmmr 😈

oops.se

Please don't ping me! That is a BAD habit.

thedeha420

sorry, didn't know

k9t33n

Yeah we are in this thread we get notifications anyway

k9t33n

Give me a sec to try this

k9t33n

Checked my command history

k9t33n

It's nmtui

thedeha420

I'll just finish drawing a princess for my daughter and I'm flying to the lab to test

k9t33n

😂

k9t33n

Okay fine with me

thedeha420

And as for notifications in the thread. I didn't have them. It's not so obvious to me. I said, real newbie

k9t33n

Just we don't like obsessive pinging because it's harder to manage notifications

k9t33n

For example pinging comes up higher on my notification list because I'm assuming it's relatively important (generally no one who I'm helping needs to ping me unless I tell them too)

thedeha420

Okay, I will write what is currently happening

thedeha420

Add > Wi-Fi

thedeha420

should I add BSSID? or just ssid and pass?

thedeha420

and what about IPv4 v6 ? Automatic?

thedeha420

to be sure I also filled in the BSSID. it threw a permissions error. I did the same with sudo. it looks like this. should I set priorities somehow?

thedeha420

or maybe I should edit "preconfigured" as my default hotspot? and delete "WiFi connection 1"

k9t33n

i thinkk ssid and password should do

k9t33n

yep unless you want a specific ip, not sure how that would work out on a hotspot though

k9t33n

oh sugar i forgot to remind you

k9t33n

you need to run it with sudo sudo nmtui otherwise it will let you do all the hardwork but then only tell you at the end and you lose all the progress

thedeha420

I messed it up as much as possible. Before you wrote I took matters into my own hands. I removed "preconfigured" (I know, idiotic) so that it would connect me directly to the hotspot. I lost the connection via ssh. I installed a new software with preconfigured ssh on the hotspot. And it connects to the phone great but I forgot that it was a new software so I don't have kismet and autoruning kismet

thedeha420

conclusions, I'm setting up the system again via Raspberry Pi Imager, with the configured home network. Then, according to your recommendations, I'll simply add a new network and test it outside the house.

thedeha420

Sisyphean work, but thanks to me

thedeha420

😄

k9t33n

oop, i did similar things too many times

thedeha420

me too with pwnagotchi. as you can see I didn't learn any conclusions

thedeha420

so, again ;)))

k9t33n

not long ago i chose to uninstall apt on my laptop os (debian) because something was wrong with my configuration and not only did it not fix the problem but i couldn't install applications (including apt) without installing them from the mirrror list directly and then using dpkg. took me several hours to even get back to where i started, and then the orriginal problem still wasn't fixed.

thedeha420

steel nerves or where I live we say "stubbornness in pursuit of the goal"

k9t33n

sounds about right

thedeha420

okay, now testing