Join us on Discord!
You can help CodeWalrus stay online by donating here.

A Python Library for Uniden DMA Scanner Communication

Started by CVSoft, January 12, 2016, 10:32:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CVSoft

Because I like RS232, I'm writing a Python library for RS232 communication with Uniden DMA scanners (BR330T, BC346T/XT, BCD396XT). Being 5 lines long in an early stage of development, I don't have a whole lot to say about it, but in the end it should allow complete programming and monitoring of the scanner via serial, and maybe even include a simple bridge for TCP/IP relaying. It'll be more of a SDK with a demo included once it's done.

This will be a progress thread as I figure out an increasing number of silly things I can do with this level of automation.
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

Yuki

I don't have those machines, but I always liked RS232 programming. Good luck!
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

CVSoft

An initial demo, to demonstrate communication and basic parsing of information:

I don't remap the characters so weird stuff shows up where small print should be.
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

CVSoft

I improved the communication code to allow faster exchanges and handle errors properly without hanging. Using a short code bit:
for f in xrange(100, 1200000, 100):
    scanner.set_freq(float(f)/1000)
    fil.write("%.3f,%d\r\n" % (float(f)/1000, scanner.get_rssi()))

I was able to get a view of raw RF power level between 100 kHz and 1.2 GHz in a neat little graph:
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

Dream of Omnimaga

So what is the main purpose of those scanners? I'm not familiar with those devices and Google images didn't show much.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

CVSoft

https://en.wikipedia.org/wiki/Scanner_%28radio%29
They quickly scan a bunch of radio frequencies and stop at any transmissions they come across.
I'm testing with a Uniden BR330T.
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

Yuki

That would be pretty useful to scan, for instance, which radio and TV channels you can get.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

CVSoft

I'll research things a bit more, and see how the output of this compares to actual software-defined radio output. In theory, it should actually work quite well despite being slow. Around 650-750 MHz you can see some spikes, those are DTV channels. The big spike in the graph is FM broadcast, and the very tiny spike at the first part of the graph is AM broadcast (local stations are stupidly strong, but the others aren't picked up by my antenna due to antenna size). Resolution can get down to about 20 kHz per useful data point, which is 50 data points per megahertz. Since data is oversampled, filtering could increase selectivity, but this is out of my scope.

I can use it to characterize noise being received on my outdoor antenna and identify what things generate RFI noise at what frequencies. Uses for such a tool are niche, but they are certainly fun.
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

Yuki

I bet, that woould be pretty fun watching all those frequencies and figuring out what is what. I remember when we still had some decent AM stations before they all closed down in favor of FM, audio quality was c (which is why the last stations to survive on AM were mostly talk radios) but on good days you could pick up stations from 250 km away. In some extreme cases you can even pick up CBC Radio from Regina, Saskatchewan in Norway.
  • Calculators owned: TI-83+ (dead?), Casio Prizm (also dead???)
  • Consoles, mobile devices and vintage computers owned: A lot
Read Zarmina!
YUKI-CHAAAANNNN
In the beginning there was walrii. In the end there will be walrii. All hail our supreme leader :walrii: --Snektron

if you wanna throw money at me and/or CodeWalrus monthly it's here

CVSoft

I can regularly pick up stations from Colorado every night (specifically KSL 1160) with better quality than the semi-local stations. With reasonably large antennas, the 1000km line can get easy to pass. The sheer number of stations is the factor that makes clear reception of distant stations difficult, as while there may be many frequencies and sparse station population, there's still multiple stations on every frequency within that large radius. The clear-channel (50 kilowatt) stations also tend to stomp out any other stations on frequency.
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

Dream of Omnimaga

  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

CVSoft

Glorious data! Blue indicates 25000 watt power or more, red means 0 to 24999 watts power. Labels should be 95% accurate. The red graph was made at night, and the blue graph was made during the day when AM broadcast can't skip.
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

Dream of Omnimaga

  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

CVSoft

It's controllable remotely by anyone at irc.digitaladdiction.info / #BR330T
It's my primary radio so it won't be up 24/7 (not even close to 24/7). It does effectively demonstrate the capabilities of my code. IRC communication is handled by an earlier work of mine, stickybot, and there's about 100 lines of code between the two programs allowing IRC to communicate easily with my Uniden communication library.
[05:07] <@notipa> set freq 152.84
[05:07] <@BR330T> BR330T> Frequency set to 152.8400 MHz.
[05:07] <@notipa> set volume 4
[05:07] <@BR330T> BR330T> Volume set to 4.
[05:08] <@notipa> set squelch 7
[05:08] <@BR330T> BR330T> Squelch set to 7.
[05:08] <@notipa> rssi
[05:08] <@BR330T> BR330T> RSSI: 463
[05:09] <@notipa> get freq
[05:09] <@BR330T> BR330T> 152.8400 MHz
[05:09] <@notipa> batt
[05:09] <@BR330T> BR330T> Battery: 3.83V
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

Dream of Omnimaga

  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal