Best posts made by Nate
RE: Writing python scripts for the RFID/NFC expansion
I'm just starting with the expansion and also finding it frustrating to use. But I had some comments on your thread and thought I'd share what I've figured out in the two days I've been messing with it.
I'm a security researcher and need to build a handheld, barry powered device to scan a client's employees badges to do an audit.
Me too! Specifically I do penetration testing of all sorts. I would think you'd want something with a bit more range for an engagement?
basically what i'm asking is how to control the rfid/nfc exp from inside a progra...any program: python node.js, etc.
First, you should forget there are any "tools" installed on the Omega for use with the expansion. And while the documentation is frustrating, it does tell us some useful information that would have taken us a few minutes to figure out or if you are me quite a few minutes to figure out:
The Expansion is based on the popular PN532 NFC Chip and communicates with the Omega via UART1.
- PN532 chip
- talks via UART1
# nfc-scan-device nfc-scan-device uses libnfc reboot-3483-gd1bcad0 1 NFC device(s) found: - pn532_uart:/dev/ttyS1: pn532_uart:/dev/ttyS1
- device is on /dev/ttyS1
error libnfc.driver.pn532_uart Serial port already claimed: /dev/ttyS1 nfc-mfultralight: ERROR: Error opening NFC device
- their "tools" are using the libnfc driver
Ok so to get back answering your question, to control the expansion from inside a program you have two choices:
- Find a library in the language of your choice that uses the libnfc driver and tell it to talk to a pn532 chip on /dev/ttyS1.
- Find a library in the language of your choice that can talk to the pn532 on /dev/ttyS1 directly.
OK, I figured it out. Here's a test script I wrote real quick to have a proof of concept:
import os scan = os.system("nfc-list") def scanFunc(): while 1: scan return scan print(scanFunc()) import string outfile = open("result.txt", "w") outfile.write(scan)
Even ignoring the issues with the code I probably wouldn't want to use this in any real-world scenario. Did you by chance come up with something else? And honestly for something like what you are trying to do here you could just write a shell script and save yourself the overhead of the python interpreter.
However, if you do want to write something in python, find a library that lets you use one of the above two methods I mentioned and I think you'll be much happier with the expansion. I know I was.
Latest posts made by Nate
problems with the o2lte command
Checking on multiple different lte boards, I noticed that once connecting to an apn ( i tried hologram and tmobile ) turning off the data connection doesn't seem to work. Even though o2lte says it turns it off, the interface is still there, it still has an ip address and traffic is still routing out off it.
There also seems to be an issue switching from one apn to another. If I add a sim after a fresh restart, it will provision it correctly, but if I want to switch to a different sim and run the apn command again, it doesn't switch correctly.
RE: Really Bad Lag
@Lazar-Demin I tend to prefer to connect to the omegas through my router once they are connected to it, instead of through their own ap. In fact I just put up another thread asking what the correct way to disable the ap is because when I tried, the sta connection never would come back up once I disabled the ap one and Ihad to connect back via the ethernet expansion.
I have a really good router but ended up buying little antennas to attach to the omegas. They have been working a lot better since then. The internal ones seem to be a bit lacking to me.
Disabling the Omega AP?
I am wondering how one might go about disabling the built-in AP on the omega devices.
I've tried both with an original 2+ as well as the newer LTE one. I have had the same results on both.
What I did was the following commands:
uci set wireless.ap.disabled=1
uci commit wireless
In both cases the wireless connection would not come back up and let it reconnect with the router. I had to put on the ethernet expansion and plug it in to the router to get back on it. Does anyone have any ideas on the propper way to do this? From what I read this was supposed to be the propper way.
RE: Ultrasonic sensor on omega2 via node red
I'm not sure if this will be helpful but when I was looking up that sensor I came across this forum thread where the modes are broken down.
RE: Really Bad Lag
@crispyoz Nah the system isn't under any load CPU or memory wise. This is definitely network related in my opinion.
@Douglas-Kryder Ok thank you sir! I'll give those a read and see what I can do. I really wanted to use a few Omega 2+s with the Mini Docks as some cheap network cameras around the house. If I can't get this resolved though I may have to switch to some rPi Zero Ws.
Really Bad Lag
Anyone else get really bad lag on their Omegas? Fresh reset on my 2+, installed mjpeg-streamer (nothing else), and now I SSH in, type a command and have to wait 5s or so for it to catch up. Also if I change the camera, it will take 15s or so for the picture to change. It was running better than this before with the only issue being a jerky picture after running for an hour or so. Any thoughts / suggestions?