Web controlled remote listening on BCD-396T

Status
Not open for further replies.

vees

Member
Premium Subscriber
Joined
Feb 13, 2008
Messages
57
I've decided to do a little programming to integrate the serial port remote control of my BCD-396T into a public web page so I can select on which talk-groups to activate in real-time while I listen remotely over the Internet.

I'm planning to make all the code open and available for anyone to use, and I would be happy if anyone else with any level of programming background wanted to help out. Just chime in on this thread. For now, all the source code and notes will be up at https://github.com/vees/bcd396t for anyone to use and improve.

The first iteration of this will be a simple web form with a list of active talk groups and channel banks currently active. The scanner would periodically check that page to determine which channels to scan, maybe once a minute or so. It could be as simple as a text file on a Dropbox account.

I'd like to get some ideas from other 396T and 396XT users as to how this sort of thing might be useful to you. I'd also be interested if anyone else has already done this successfully, or even tried and failed but kept good notes on what went wrong.

I'll keep both my programming journal and this thread updated as I make some progress on this project. Please let me know what you think.
 

W2PMX

Member
Joined
Oct 29, 2011
Messages
333
Location
Fayetteville NC
AARRGGHH! Python.

I've already done a complete remote control in VB6 ("done" = about 10 minutes of planning and 2 minutes of coding - Uniden makes remote control trivial), but I've only spent about 5 minutes looking at Python, and I don't have the time to devote to learning it. (If I learn a language, I learn it as well as the languages I currently use, and that means at least a month of full-time study, just to start). I do all my web programming in PHP these days. Doing this in PHP is possible if the server is running on Linux. If it's running on Windows, it would probably require Serproxy, and installing a binary on a hosted server might be a problem.

If you can read VB6, I'd be glad to email you my code. It includes just about a full duplicate of the Uniden DMA scanners' front panel (the 15/996 panel, which is easier to "work" than the 396).
 

vees

Member
Premium Subscriber
Joined
Feb 13, 2008
Messages
57
AARRGGHH! Python.

I've already done a complete remote control in VB6 ("done" = about 10 minutes of planning and 2 minutes of coding - Uniden makes remote control trivial), but I've only spent about 5 minutes looking at Python, and I don't have the time to devote to learning it. (If I learn a language, I learn it as well as the languages I currently use, and that means at least a month of full-time study, just to start). I do all my web programming in PHP these days. Doing this in PHP is possible if the server is running on Linux. If it's running on Windows, it would probably require Serproxy, and installing a binary on a hosted server might be a problem.

If you can read VB6, I'd be glad to email you my code. It includes just about a full duplicate of the Uniden DMA scanners' front panel (the 15/996 panel, which is easier to "work" than the 396).

I've found lately that Python is my fastest language for rapid prototyping, but I could see writing a client interface in any language that supports serial interface, and the web interface in any good web language.

Probably the sweet spot would be a Windows executable in some .NET language that folks could load on whatever Windows PC is connected to their scanner, plus a plug-in to a common web site framework like WordPress written in PHP to select channels.

Please do send me your VB6 code so I can learn from what you've done. My email is rob@vees.net.
 

Ed_Seedhouse

Member
Premium Subscriber
Joined
Jul 10, 2010
Messages
570
Location
Victoria B.C. Canada
AARRGGHH! I do all my web programming in PHP these days. Doing this in PHP is possible if the server is running on Linux. If it's running on Windows, it would probably require Serproxy, and installing a binary on a hosted server might be a problem.

I use php on windows all the time. You can download the XAMPP binary from, among other places apache friends - xampp for windows, install it, and presto you have an Apache server, mysql, PHP, phpmyadmin, Filezilla, and Tomcat. Also I believe there is a python version available for it. Mine also has Perl and various other goodies. Works pretty well exactly like the linux version.

There are other packages like this, too. There's WAMPP (WampServer, the web development platform on Windows - Apache, MySQL, PHP). You can also install Python on windows and there's a full unix command shell you can install under windows if you want, even does XWindows (slowly!), sorry the name escapes me for the (senior) moment.

I run a local version of Wordpress locally for testing. Then I upload the results to unix servers and run websites for a few local volunteer organizations. Works exactly the same under each O/S. I would never use Microsoft Web Server based on earlier experiences with it. First thing I do with every new Windows computer is get Apache, PHP, and MYSQL installed. I have my own local home page to which my main browser, Firefox, always goes first, which gives a tab based interface to my favourite links using PHP and mysql. Except I use Microsoft Access to administer the tables!

Actually I find Access is an excellent database front end whose underlying table structure rather sucks. So I generally use it as an interface to mysql tables.
 
Last edited:

W2PMX

Member
Joined
Oct 29, 2011
Messages
333
Location
Fayetteville NC
I use php on windows all the time. You can download the XAMPP binary
Thanks Ed. I write PHP for a living, so I have XAMPP on every computer I own, even the little netbook. And Bambalam is on all of them too, in case I want to compile something.

You can also install Python on windows
Have it, looked it over and decided that it needs more time than I currently have. (Have to do a massive 4 week project that I was given late Monday and it has to be finished by COB tomorrow. That's how my life has been running recently - pulling rabbits out of non-existent hats. No time to learn a new language.)

I run a local version of Wordpress locally for testing.
I run a local version of everything. The only one who sees my dirty laundry is me.
I would never use Microsoft Web Server based on earlier experiences with it.
We run that too, on a few of our servers. It's different, but it's almost as good as Apache. Kinda sorta.
Actually I find Access is an excellent database front end whose underlying table structure rather sucks. So I generally use it as an interface to mysql tables.
I like its files for small programs. I can ship a program with no database and if there is none, the program creates the file with the tables, queries, etc.. I also use it to front-end an RDB-7 database. The console we use to access the Vax that the database runs on doesn't suck - if it were that good I'd use it instead. For MySQL I use phpMyAdmin, or I whip up a little PHP program to do what I need at the moment.
 

vees

Member
Premium Subscriber
Joined
Feb 13, 2008
Messages
57
I have a fairly nice working client-server prototype using a combination of Python (client) and PHP (server).

The Python client is running on my computer at home and every minute or so it:

- Checks on the status of the scanner and records the text on the display
- Connects to the web service (PHP) code on my hosted web site to update the display and check for any instructions to change the channel
- Activates any requested quick-groups on the scanner
- Waits another minute to repeat the process.

I haven't had a chance to commit the updated PHP portion to the github.com site, but the Python library is pretty solid. This evening after work I will try to update it for folks to review and comment on.

You can see a working version at: https://vees.net/scanner/

For now I've had to disable most channel group selectors in order to stay within RadioReference streaming TOS, but this shows a simple proof of concept.
 

vees

Member
Premium Subscriber
Joined
Feb 13, 2008
Messages
57
All source code changes from this weekend are posted up at https://github.com/vees/bcd396t for anyone to review, use, and test.

My next round of code is probably a Windows-based client, written in C# with .NET Forms or WPF and a specification for a language-neutral web API.

Please let me know if there's any interest there.
 

Tryton

Member
Joined
Sep 15, 2007
Messages
562
Location
Largo, Fl
Great Job Vees!! I was thinking about How cool it would be to have some type of remote software that would allow full control of a 996XT (including a text box to add a freq on the fly)
Keep up the great work!
 

vees

Member
Premium Subscriber
Joined
Feb 13, 2008
Messages
57
Great Job Vees!! I was thinking about How cool it would be to have some type of remote software that would allow full control of a 996XT (including a text box to add a freq on the fly)
Keep up the great work!

Do you mean save a new frequency into a system-group or just have that frequency tapped into the VFO for immediate listening?
 

Tryton

Member
Joined
Sep 15, 2007
Messages
562
Location
Largo, Fl
Do you mean save a new frequency into a system-group or just have that frequency tapped into the VFO for immediate listening?

Both would be ideal, but if I had to choose one, it would be VFO for immediate listening.
 

W2PMX

Member
Joined
Oct 29, 2011
Messages
333
Location
Fayetteville NC
Do you mean save a new frequency into a system-group or just have that frequency tapped into the VFO for immediate listening?
How about duplicating the front panel, so the user could choose to do anything he can do from the scanner itself? Uniden has put all the needed commands in the command set.
 

vees

Member
Premium Subscriber
Joined
Feb 13, 2008
Messages
57
How about duplicating the front panel, so the user could choose to do anything he can do from the scanner itself? Uniden has put all the needed commands in the command set.

I'd probably avoid doing direct control for a few reasons:

1. Uniden already offers the software that can do this. If a single person wanted to control their scanner they could remote (or GoToMyPC or whatever) into their home PC, run the Uniden provided software, and push all the buttons they wanted.

2. The current mechanism I'm using is for a client program on my home computer (on the east coast) to contact my web server (on the west coast) every two minutes for new commands based on the actions that listeners have taken. This means that folks on the Internet never connect to my home PC directly and couldn't even if they tried.

This is great from a security perspective: you can't (easily) hack a program that doesn't accept incoming connections. It's also lousy for providing a rapid response to commands from the web since every command is queued up waiting for the scanner to check in. It would be anywhere from 1 to 120 seconds after I pressed a button that the scanner would check in for new commands.

3. It doesn't lend itself to a collaborative listening experience. If 30 listeners are all trying to control a single keypad at the same time, you have chaos. A web interface to de/activate and add talk-groups and quick entry frequencies for a short duration lets everyone play fair and allows the software to sort out conflicts (8 people want a talkgroup on, 2 people want it off) before the commands get relayed to the scanner.

Thanks for asking the question. I hadn't actually articulated any of my assumptions about this project before, so this was useful for me to write. I'd be interested to hear some counter-arguments to the points above -- I'm not above changing the architecture if I can make this project useful to a broader range of people.
 

vees

Member
Premium Subscriber
Joined
Feb 13, 2008
Messages
57
In case anyone is still paying attention, I've added better mobile browser support to the front end, and making plans for the next set up updates. I give myself about an hour a week to work on this. Any volunteers for beta testing would be welcome. Check out my working prototype at: https://vees.net/scanner/
 

mibzzer15

Member
Joined
Apr 14, 2009
Messages
394
Location
Fremont, CA
As I have no real programming experience, how hard would this be to get a version of it working for my personal use on a 996xt?
 

vees

Member
Premium Subscriber
Joined
Feb 13, 2008
Messages
57
What sort of home computer and web space setup do you have?
 

mibzzer15

Member
Joined
Apr 14, 2009
Messages
394
Location
Fremont, CA
Win7 home computer with 996xt hooked up to it (for recording and logging). I own CheatFUSD . I do not host my own server as I have bought the space thru hostgator.com.
 

vees

Member
Premium Subscriber
Joined
Feb 13, 2008
Messages
57
Right now you need PHP and a database on the server. On the client side, it's a little harder since I don't have easy access to a Windows machine to test the serial/USB connection to the radio on.
 
Status
Not open for further replies.
Top