Barcode displayer (replacement for Pebble's Skunk) #6361
Replies: 1 comment
-
Posted at 2023-08-22 by @allObjects @akisame, checkout @MaBecker 's conversations and contributions and start talking to him. - ao Posted at 2023-08-23 by Akisame Thanks. I see he's taking the pre-generated image approach. With the bangle js 2's resolution I foresee issues with misinterpreting the R encoded portion for EAN-13 barcodes. Posted at 2023-08-26 by @halemmerich I don't know anything about scanning or encoding bar codes, but could you maybe get this working by displaying the bar code diagonally on the display to get 2*95 pixels without scaling? It might throw off the scanners when slightly misaligned but could be worth a shot. Posted at 2023-08-26 by Akisame Ooh, it works for EAN-13. It just uses the build in error checking. Code 128 just doesn't work. It needs a higher resolution. Posted at 2023-08-27 by @thyttan https://www.espruino.com/ReferenceBANGLEJS2#l_Graphics_drawLineAA Posted at 2023-08-27 by @MaBecker If the display is to small for barcode than think about qrcode. Posted at 2023-08-27 by Akisame @thyttan yes. Bangle 1 has AA support. I thought bangle 2 doesn't. Posted at 2023-08-27 by @thyttan
You may very well be right! :) But the link is specifically to the Bangle.js 2 reference. If AA is only on Bangle 1 maybe it should be taken out of there. Posted at 2023-08-27 by @MaBecker EAN-13 has a checksum digit, is that what you mean? What barcode types are typically used for those cards? Posted at 2023-08-27 by Akisame @MaBecker yeah, EAN is actually quite clever in its error correction with the L, G and R encoding. Posted at 2023-08-29 by @gfwilliams I believe Bangle.js 2 does have all the AA functionality but the screen is only 3 bits so it's of limited use unless you dither. If you did want to have some antialiasing maybe consider using one of the colours as a 'grey' - for example White,Red,Black ... but whether that would be useful with a normal red-light barcode reader I don't know. Having said that, the barcode reader probably won't be pin-sharp so I imagine that dithering may well be good enough Posted at 2023-10-02 by Akisame Okay. I had a bit of time today so I added the code 128 support. The code is a bit long (12.8 kb, 295 lines of code) and can probably be optimized further. Posted at 2023-10-02 by @thyttan Just a FYI if your not aware of Cards app by @glemco, PR here. Seems pretty adjacent, maybe it makes sense for you to collaborate? Posted at 2023-10-02 by @MaBecker Nice, thanks for sharing Posted at 2023-10-02 by Akisame I was actually not aware of the Cards app. Yeah, would be cool to have it all in one place. Posted at 2023-10-04 by glemco @akisame the cards app is roughly a proof of concept. It works fine with gadgetbridge (catima sync) but the rendering of codes is way far from being perfect. I tried some open source libraries but feel free to fork/enhance the app with your own renderers. Posted at 2023-10-05 by Akisame @glemco thank you. I don't have much free time but I'll have a look when I have time. Posted at 2023-11-03 by fparri I tried it some days ago and I can sync my Catima cards. Unfortunately when I try to display them, the watch reboots. Any idea why? Posted at 2023-11-03 by Akisame That is because I haven't had the time to make it fully functional yet. Posted at 2023-11-03 by glemco @fparri keep in mind that (as I wrote in the readme) the app is mostly a proof of concept for now, as you noticed sync works, but code generation is done on the device and not in the best way. Posted at 2023-11-05 by fparri Great! Thanks for your good work :) Posted at 2023-11-05 by fparri Understood. You're right, I tried it and many of the simpler QRs work :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-08-22 by Akisame
So, I've been working for the last 15-20 minutes on a barcode displayer for the Bangle JS 2 (since my pebble died and I miss the Skunk app). I've started with implementing EAN-13 barcodes first.

It works but on 1:1 scaling it is too small and due to the resolution of the screen I have to depend on the parity bit to fix the errors that occur when scaling it up to the full size of the screen.
An EAN-13 barcode has 95 lines and with a resolution of 176 I can't do perfect scaling.
The alternative would be to split it into 2 sections and depend on the decoding algorithms of barcode scanners. This would exclude non-laser barcode scanners though.
Are people interested in this kind of app? If so I'll probably develop it further and put it in the app store.
If not then I'll just make it functional for my barcodes and leave it at that.
This is the code so far:
Beta Was this translation helpful? Give feedback.
All reactions