Open gersmit opened 2 years ago
Hello, As for using this code, it is intended to be imported as a module, there are some examples in the utils directory of using the module. I do not know if the BR330T used the method to control and program as the device I've tested it on (BCP996P2). I know a lot of the different Uniden scanners use different AT command sets if not different methods for programming.
Hi Ben, thanks for the fast answer. It is with the script scanner.py possible to make contact. get error when i use PORT = '/dev/ttyACM0' Traceback (most recent call last): File "/home/pi/.local/lib/python3.5/site-packages/serial/serialposix.py", line 265, in open self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK) FileNotFoundError: [Errno 2] No such file or directory: '/dev/ttyACM0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/piscannerwebcontrol/pyUniden/utils/scanner.py", line 174, in
When i use PORT = '/dev/ttyUSB0'
sendcommand: ff
['ff']
Traceback (most recent call last):
File "/home/pi/piscannerwebcontrol/pyUniden/utils/scanner.py", line 174, in
Do you have a test script only raspberry pi connect to the scanner with serial usb cable? Where can i find the AT commands so i can test. When i can make contact then i have something.
Thanks and gr Ger
I did a quick search and found the guide for your model, https://www.uniden.info/download/files/BR330T_REMOTE_COMMAND.pdf It looks pretty similar.
I would validate you are using the correct items in /dev you can often see which one is assigned when plugged with the command 'dmesg'. From the output, you sent using "/dev/ttyUSB0" it looks to be the wrong device. Additionally, you will need to make sure the user you are signed in as has permissions to read and write to the device, often you will need to add the user to the 'dialout' group.
@suidroot Dear Ben,
Thank you for taking the time to explain to me. I have not done serial communication with the RPI before. You gave me good explanation and got all modules working via PORT = 'dev/ttyUSB0'. I have modified many IndexError: list index out of range. Only restserver.py. gives some problems. Is it true that your program can work through the web server?
I get with restserver.py http://0.0.0.0:8080/. How can I set this with the IP address of the RPI on which the program is running? I hope you will provide me with some more information. What is the meaning of all the modules?
Thanks and greetings Ger
Dear Ben,
One small question: Is it possible to get only the scan details as frequency, and the names of the channels so i can see with one eye witch frequency is talking.
The rest server when showing 0.0.0.0 listens on any IP address on the Pi and it provides a handful of calls for muting and setting volume. It should be pretty easy to extend for other functions as needed.
I'll look at adding that functionality in the future, please feel free to add and extent functionality through pull requests.
@gersmit Hi Ben, I've been playing around with the modules again and I'm getting good data out of the BR330T. I'm not a professional python programmer so here's the question. What steps should I take to work via the web server. If I know this I can add some parts myself. Do I not need index.html or anything else?
would love to hear from you again Thanks and regards| Ger
I get error: http://0.0.0.0:8080/ 192.168.178.101:62489 - - [01/Feb/2022 15:14:23] "HTTP/1.1 GET /" - 404 Not Found
The restserver.py just has a handful of URLs address developed. For example, to mute the scanner you would access: http://<IP>:8080/mute
. From the code here are the other URLs currently built out.
URLS = (
'/mute', 'mute',
'/volume/(.*)', 'volume',
'/pushbutton/(.*)', 'pushbuttons'
)
I totally get it and it's going to work. Small question: Do you know if it is possible to write to index.html and how to do it?
It is possible, that script is using the https://webpy.org/ framework. There are a couple of ways to go about having an index.
@suidroot , Hello Ben,
My name is Ger from the Netherlands. I am very intrested in your scripts for remote Uniden radio scanner. I wonder if it is possible to use my scanner BR330T (UBC3500xlt). When i run the program it is doing nothing. I use a usb cable with the serial inside (attachement) Can you explian to me how to handle. I am using Raspberry pi 3.
When i use your pyuniden init.py then get error ==== RESTART: /home/pi/piscannerwebcontrol/pyUniden/pyuniden/init.py ==== Traceback (most recent call last): File "/home/pi/piscannerwebcontrol/pyUniden/pyuniden/init.py", line 3, in
from .pyuniden import *
SystemError: Parent module '' not loaded, cannot perform relative import
Thanks in advance for answer greetings Ge r