Live data from Hacker News

Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

bcarrigan.com

51–60 of 60 posts

Re: Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

#51
post #50
post #35

Earlier quoted context omitted.

For decoding serial one of those $5 logic analyzers is more than sufficient, you don't really need an oscilloscope at all. I don't really like using protocol decoding on my scope unless I need to correlate timing with an analog signal because it's tedious to set up and use for a simple digital signal. https://www.aliexpress.com/item/New-Arrival-USB-Logic-Analyz...

RS232 is 12V, but a couple of resistors would sort that out. If you're a beginner I would actually recommend the Saleae Logic Analyser over this scope, unless your routinely dealing with analog or voltages over 5.5V, the Saleae is much more useful, has serial (and other) decoders built in as opposed to having to pay extra on the Rigol, has better capture and triggers plus as a bonus it doesnt have that noisy fan goin…

Yeah, in the article he uses a good old MAX3232, which is specifically for doing RS232 to TTL level shifting. Totally agree, the Saleae or one of the cheaper clones I linked is a better choice for most hobbyists. Scopes are indispensable for certain uses, but most Arduino/RasPi projects these days are all digital and you can do everything you need with a logic analyzer + a decent multimeter.

I use my scope just often enough that I'm glad I have it, but I sometimes also regret buying it because it's not that often that I actually need it.

Re: Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

#52
post #45
post #17

The laser scanner is kind of fancy, but you can get USB scanners for $10-$20 that present as keyboards. For me, the most interesting part of this is looking at Elixir.

This all reminds me of the CueCat[0] scanners I picked up for free from Radio Shack so many years ago. [0] https://en.wikipedia.org/wiki/CueCat

Same! I also remember the CueCat's XOR-based ""encrypted"" output :-) Found an article from 2000 on this! https://www.securityfocus.com/news/89

Re: Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

#53
post #2

I love these little stories, they always make me want to go out and buy a proper oscilliscope so I can start my own adventures. I'm surprised by how simple and easy to understand the data serialisation is on some bits of hardware as in this case.

Having an oscilloscope is great, and it needn't be thousands.

For general tinkering and exploring I picked up the Digilent Analog Explorer 2 with the Ham Radio bundle[1]. They had a coupon deal where 'hamradioworkbench2018' would unlock a $100 discount. Not sure if that still works. While it is a USB scope (so you are dependent on your PC/Laptop for a display) it includes some other useful bench top tools.

Used scopes in the 100 - 200 Mhz range from the 90's are often pretty inexpensive and can usually be calibrated and repaired. This is especially true of the Tektronix 465 and 475 series which were sold in huge numbers. While not as crisp as a digital scope they work well and can be found (at least in the Bay Area) for $50 - $100. About double that on ebay.

The Rigol folks really pushed the price point hard and their DS1054 and DS1102D series are fairly common and inexpensive at $300 - $500.

Scrounge around HAMFests or surplus liquidators and you can often find a deal if you know what you want.

[1] https://store.digilentinc.com/ham-radio-workbench-bundle/

Re: Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

#54
post #9

Earlier quoted context omitted.

Right now I'm going very low tech for recipe management...I send a DM to my SO on slack. That's most of what we use the DM for, an archive of things we've made. We mostly need a bigger screen in the kitchen that stays on while making a recipe. A Microsoft Surface we have laying around will be used for that. I'd like to do a database of products purchase, purchase date, price paid, scan a barcode and mark it as consum…

I'm working on this idea too! Hit me up on gmail! Love to chat.

Apparently many grocery store chains offer APIs where you would be able to download information on what you bought. Anybody know more on this?

Re: Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

#55
post #38

Earlier quoted context omitted.

Wow, it also has drivers for the raspberry Pi ! https://www.picotech.com/support/topic14649.html This pairing would make for a trully tiny all in one oscilliscope, i'm tempted to get a picoscope and a tiny LCD just for laughs: project #1

You may not want to do that. The sampling rate is very important on a scope, especially for analog signals because of Nyquist.

Hmm, I was expecting the sampling frequency to have been made independent of the USB bus, (i.e for the sampling to occur purely on the picoscope itself and data merely relayed over USB).

I don't even know what the frequency limitations of USB are I just know it's capabilities are highly dependent on the host so relying on it for precise high frequency sampling seems like a bad idea, and if that is the case for the picoscope then you are correct, I just find it a surprising design decision.

Am I wrong in thinking this? or are you referring to a different reason?

Re: Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

#56
post #17

The laser scanner is kind of fancy, but you can get USB scanners for $10-$20 that present as keyboards. For me, the most interesting part of this is looking at Elixir.

I've seen a website that has control codes for a particular scanner, because it doesn't just send digits/letters but the device can be controlled by special barcodes to send/hold Ctrl or Alt on the "keyboard". He was using it to access the OS behind the kiosk UI on a ticket machine.

Re: Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

#57
post #54

Earlier quoted context omitted.

I'm working on this idea too! Hit me up on gmail! Love to chat.

Apparently many grocery store chains offer APIs where you would be able to download information on what you bought. Anybody know more on this?

I checked Aldi and two regional grocery stores near me...no public API. One does have a delivery service, but that API is closed off it looks like.

Re: Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

#58

Earlier quoted context omitted.

In my previous life I worked on kiosks using POS equipment like this. Scanners are typically just keyboard interfaces. The barcodes are essentially very old school QR codes that actually type the information. Card swipers are the same to a degree. They read up to 3 levels of the magnetic strip and essentially type the card number and cvc into POS systems. Debugging these usually would involve opening up Notepad in Wi…

The Symbol/Motorola/Zebra/whoever-owns-the-brand-this-month li2208 is cheap and can read a phone display. I think it can decode PDF417 (? The 2D barcode on the back of your driver's license) but Im not sure about QR

I think by default it handles pdf417 but you could enable a few other formats through configuration. QR seemed to be easily supported by even the cheapest models 6 or so years ago. It's like the scanner tech itself kinda stayed the same but what changed was the connectivity to the PC, moving from serial to serial-over-usb. At least that's what it looked like with the sample scanners I had access to.

Re: Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

#59
post #5

Earlier quoted context omitted.

Yes I was just looking at it, £300 seems pretty reasonable. A while ago I was looking at old used stuff but even they are in the thousands. Thanks for recommending it, it's nice to know some HN readers are using it because I don't really know what to look for in an oscilliscope :)

I know Rigol was doing a promotion around the holidays where they'd give you expanded bandwidth, serial decode/trigger, and a few other goodies at no charge. Of course, you can always just see about taking matters into your own hands ( http://gotroot.ca/rigol/riglol/ )

Test Equipment dot Net is running the Rigol promotion through June:

https://www.tequipment.net/rigol-promotions-and-offers/

Re: Show HN: Giving a Broken Barcode Scanner a New Life with Elixir and Nerves

#60
post #55

Earlier quoted context omitted.

You may not want to do that. The sampling rate is very important on a scope, especially for analog signals because of Nyquist.

Hmm, I was expecting the sampling frequency to have been made independent of the USB bus, (i.e for the sampling to occur purely on the picoscope itself and data merely relayed over USB). I don't even know what the frequency limitations of USB are I just know it's capabilities are highly dependent on the host so relying on it for precise high frequency sampling seems like a bad idea, and if that is the case for the pi…

Yes, all the sampling is performed on the Picoscope and then streamed over USB.

This is something that you need to grok when using scopes: you're capturing (often) a teeny-tiny snapshot of time. The waveform on your display might be 50ns wide. You certainly can't process this data in real-time using your eyes (that'd be 20 million frames a second). So you're not seeing a continuous signal, you're seeing short snippets of your signal separated by some dead time. The majority of this dead time is probably just writing to the display. You're not pushing pixels to the display at the sampling rate of the scope, otherwise these would be some of the best monitors in existence!

Usually scopes are triggered somehow and you'll be sent waveforms, typically centred on the trigger point, at some maximum frame rate. So you'll see a little bit before the trigger and a little bit after. Most scopes let you vary the trigger offset, e.g. if care more about stuff that happens before or after. Using an oscilloscope well is all about the triggering!

The scope will have (a) a max. sampling speed and (b) a fixed size sample buffer. You trade off both. You can sample really fast for a short period of time, or slower, but see a longer time period. If you want to see 'all' the signal, then you can set the timebase to something long - e.g. 100ms/div. That's useful for seeing slowly varying signals, but you'll lose resolution. A scope with a nice big sample buffer will let you zoom in on a signal once its been captured.

Once the buffer is full, the scope has to transfer that data to you, either directly to a screen or over a serial connection. Unless you're in single shot mode, this process will repeat every time the trigger condition is satisfied.

Post reply on HN