![]() |
Re: mbarcode
I've been doing some updating to the main mBarcode program - I've updated the plugin settings dialog so that you can enable/disable plugins, this means that they then won't be displayed on the Results page. If you disable all but one plugin, and tick the reelvant checkbox on the settings page you can have mBarcode automatically run the enabled plugin (might be useful for stocktaking, adding to lists, etc.).
I'm currently trying to work out why slot methods don't get called in the Python plugins, but the biggest annoyance of my past week of mBarcode hacking is that I added an on-screen button to allow the user to load and scan from an image file (no icon atm, so we have 2 spanners on the RHS) but I can't for the life of me get it to work (i.e. successfully decode the image data it's passed) - I've added debugging output, saved the frames coming from the normal video stream and that generated from the image file, and still I can't see what the problem is. Anyway, I'll push an update in the next day or so (will mean bumping all the plugin packages too as the plugin api has been modified to allow for enabling/disabling plugins), but if anyone fancies doing some debugging of my image loading/decoding problem (and you'll need to modify the code, and certainly need to look at an understand it) please let me know. Cheers :) P.S. I've also started adding more stuff to the maemo.org wiki page: Explanation, howtos, todo, etc. I'll get there in the end! Please feel free to add useful docs/screenshots/other description stuff :) http://wiki.maemo.org/MBarcode |
Re: mbarcode
|
Re: mbarcode
we need all the support we need lol
|
Re: mbarcode
Quote:
First step is to add an enhancement bug to the bugtracker so that we can keep track of things in one place: https://bugs.maemo.org/enter_bug.cgi?product=mbarcode Next step is to see if ZBar (or libdmtx) are considering adding these (and whether there's any code that can therefore be worked on), if not, the next step is to see if there are any open source decoders available so that we could add in an extra decoder. If none of those work, then patches are of course always welcome :) |
Re: mbarcode
Ah, I've fixed the Python scripting plugin (signals and slots now working, yay!), so once I commit that later on today (with the updated version of mBarcode) you'll all be able to write nice Python scripts to handle barcode payloads! :)
|
Re: mbarcode
Right, new version of mBarcode and all the plugins (just bumped the version number as they are compiled against the new plugin api) on their way to extras-devel.
|
Re: mbarcode
Oh btw, here's some skeleton-ish code for your Python plugins: https://garage.maemo.org/plugins/scm...de&view=markup
Stick them in /usr/share/mbarcode/plugins/pythonqt/ |
Re: mbarcode
Thanks a lot for mBarcode! Just downloaded Firefox beta with it.
https://www.mozilla.com/en-US/mobile/beta/ |
Re: mbarcode
Quote:
|
Re: mbarcode
Quote:
Right now new Mbarcode cannot work because of my out-of-date plug-in. Just crashes at first loading of the plug-ins. Are getImage and getInformativeText mandatory functions? I will upload here code and compiled library if I manage to compile my plugin with new API. EDIT: Now Mbarcode doesn't crash and it can scan a barcode and display results, but it doesn't see my plug-in at all. What am I missing? It's not in the list of plug-ins. EDIT: Ok, it works now, I'll need to add some code so that informative text was more informative than short text. Note: I don't really understand how can signal be connected to MaemoBarcodeWindow* parent when I haven't taken plugin's parent at all; this->parent = parent; is obsolete. But it doesn't really matter. Note about QrCode plugin: its image is too small in "Set Plugins" window. And if some-when I will need to use an image, I would be interested in knowing how to adapt it to needed size (small in results, large in settings). |
Re: mbarcode
Quote:
I'll get round to updating the plugins page to reflect the new callbacks and the Python plugins. Quote:
Quote:
Quote:
I'll get round to making the plugin settings window use a custom delegate + renderer, but I thought people might like some working, if cosmetically not optimum, code before I headed off for Christmas :) |
Re: mbarcode
Hi,
I've been using mbarcode for a few weeks now, mostly for fun and to show off the phone, as I did not have a real use for it. It works really well, though. Recently I tidied up my library and thought that it would be a good idea to index it, since I found out that I'd bought a few books twice, after thinking that I'd lost my original copy (yes, I'm that well organized). So basically I wrote a pretty straightforward Perl script to read a list of ISBNs, ask Amazon for metadata on the books, and write the metadata to a database. Now I just need a way to get the ISBNs without typing them one by one. This is where I finally have a real use for a barcode reader. I tried zbarcam but it dies immediately on my N900 ("system error: queuing video buffer (VIDIOC_QBUF): Input/output error (5)"). Basically, what I need is a simple plugin for mbarcode that appends the decoded data to a text file. If I understand correctly, if only one plugin is activated, it is possible to make it run immediately without going through the "results" window. Since I have a) little C++ skills and absolutely no Qt experience, and b) not managed to make the Python example show up in the plugins list, and even less Python experience than C++... I guess I'm requesting a feature? (Boy, I hate writing feature request posts, it makes me feel really unappreciative of the existing functionality.) |
Re: mbarcode
Quote:
I've been doing some hacking on a Python app to do this, but it's no-where near finished (itemdb in Garage, and in fact I need to push some updates to that). In the short term, let's see if we can get your Python save-to-a-text-file code working - can you create a tarball and attach it (.py is not allowed as an extension for attachments) or copy and paste the code into a reply? Also try starting mBarcode from the terminal and see what the error is (it will tell you why the plugin didn't load). |
Re: mbarcode
Quote:
|
Re: mbarcode
1 Attachment(s)
I've not tried this, but it should do basically what you want, hopefully!
Touchscreen seems to have just failed on my N900 so I can't actually test it. |
Re: mbarcode
Quote:
Code:
Created scannerI do have the python wrapper plugin installed, by the way (unless the version currently in the repositories doesn't work, or is that the same as SVN head? I am not familiar with garage either...) (edit) I should add my thanks for replying this fast on New Year's Eve, and even producing code for a random user! |
Re: mbarcode
It should be placed in /usr/share/mbarcode/plugins/pythonqt/ part of the app is optified, and eventually that directory will be a symlink to the /opt stuff.
Curious that you don't see any output in the terminal. My N900 has suddenly started working again (thank goodness!) so I'll have a look myself and get back to you. |
Re: mbarcode
1 Attachment(s)
Right, 'twas my fault. I've just pushed updated versions of mBarcode and the pythonqtwrapper plugin to Extras-devel. These should provide more debugging output now. In addition the problem was that I'd not added a dep on libshiboken1.0 for the pythonqtplugin (though I have now).
I've also attached a fixed version of the Python code (you need to install python-pyside manually - normally this would be a dep of this python code's deb file. This is quite a large install, but it goes to /opt, so shouldn't be a problem. OTOH as it doesn't actually use PySide you could well be able to remove that import & superclass references (to QtGui.QWidget iirc) and see if it works anyway.) In any case let me know how you get on, and a Happy New Year to everyone :) |
Re: mbarcode
1 Attachment(s)
OK, it works better now. I installed python-pyside, updated mbarcode and plugins. The plugin appears in the list and outputs correctly to barcodes.txt, looks good.
The problem now is that the Results page appears even if the "Auto-run plugin" option is checked; not only this makes the workflow difficult (ideally you'd just run the camera over the barcodes with no other interaction necessary), but there is nothing to interact with on the page (I disabled all plugins except the isbn saver), it just stays there and doesn't respond to the back button either, so it needs to killed from the window switcher. Attached is the stdout and stderr from mbarcode while it's started up, scans a barcode, looks for plugins, does its thing with the barcode, displays results and is killed from the window switcher. Happy new year to all. |
Re: mbarcode
1 Attachment(s)
Right, fixed that problem and a few others, I'm currently trying to push to Extras-devel, but the autobuilder web page doesn't seem to be responding.
Hopefully just a temporary glitch, I'll try again this afternoon. In the meantime I've attached the updated deb here. |
Re: mbarcode
Very nice. I've scanned a couple dozen books and entered them into my database.
Now my problems are no longer related to the lack of a barcode reader. I still need to peel off barcode stickers when the bookshop used their own system instead of the ISBN, and try and make my Perl script grok Amazon locales, since a lot of my books are French, but not all. A couple comments on this latest update of mbarcode: This doesn't appear (usually?) when scanning a couple barcodes, but mbarcode sometimes hangs when going back from the Results window. Interacting with the interface wakes it up after a few seconds, or maybe it wakes up on its own anyway? This is annoying but can be worked around, and anyway it beats reading ISBNs one by one, by miles. Sometimes after a successful scan and return from Results, the scanner will re-read the latest frame it had (apparently), and since it's in focus and has a valid barcode (since it was scanned last time...), it's immediately scanned. This produces duplicate barcodes (and slows down the workflow), but nothing that can't be worked around with "cat barcodes.txt | sort | uniq". The problem is of course that if there are actual duplicates, for instance two identical books, they will be lost after deduplication. The following is output on the console: Code:
[...] |
Re: mbarcode
Quote:
Quote:
ATM the camera pipeline is suspended when results window is going to be displayed, but if it's hidden too quickly the main video widget gets confused and thinks it's still hidden (presumably because the event hasn't had time to be delivered, but I don't really know.) To work around this I've delayed the results window from being hidden by iird 1000ms, but perhaps I should increase this a bit to ensure that hide & expose events get propagated. Quote:
Quote:
|
Re: mbarcode
Quote:
Quote:
As an aside, I've added a kb shortcut to perform autofocus when you press the enter key (as this was troublesome when I was testing the continuous scanning). I'll have a think about how to fix the double scan business then push an update as the autobuilder has woken up now :) |
Re: mbarcode
Right, I've fixed the double scan problem by adding a 100ms pause before scanning recommences after finding a barcode, this is short enough (I hope) to not be annoying, but long enough for the GStreamer video pipeline to clear any remaining frames of the barcode so you shouldn't get double scans any more (fingers crossed! ;))
version 0.3.0-3 should be in Extras-devel soon (once it's finished building on the autobuilder). Let me know if you have any more troubles :) |
Re: mbarcode
how about adding the functionality to bring up a scanable copy of bar code stored, for example, membership/loyalty card at grocery stores. See the following iphone apps.
http://www.usefultools.com/2009/11/a...alty-card-app/ http://www.usefultools.com/2009/08/l...p-the-savings/ |
Re: mbarcode
That's not really what mBarcode does - mBarcode allows you to scan a barcode and use the data it contains, those apps simply store an image of the barcode on your loyalty card and allow you to scan the image on your screen at the shop rather than needing the card.
You could do this by just taking a picture of the barcode and scanning the right one as displayed by the Images application. Certainly it might be a useful app (though I only have one card that has a barcode, for Tesco, all the others have magnetic strips), but afaict it's not something mBarcode can help you with. Sorry. What would be cool though, would be to use the location services to know which shop you're in and automagically present the right barcode image ;) |
Re: mbarcode
When i do a scan and then go to the "Rating from Informed Individual" when i tap on Open Web Browser nothing happens, also I see "Type or paste verification code" What is the verification code... Thanks
|
Re: mbarcode
Quote:
|
Re: mbarcode
Quote:
I'll get back to you once things calm down and I can resume cataloguing my library. Do you use your bugtracker or is this thread the preferred means of communication? |
Re: mbarcode
Quote:
Quote:
Good luck with your new job! |
Re: mbarcode
My apologies if this has been covered earlier in the thread.
I own a bar and I wanted to use mbarcode to do the stocktake in the bar. But it appears to have big problems with barcodes on bottles that are on horizontally. Vertically is no problem at all. So I think mbarcode has trouble dealing with barcodes that are on something round. Any setting I could change to improve on this? It works lightening fast on flat barcodes on my phone, great program there!:) |
Re: mbarcode
Quote:
This is something that needs to be improved in the libzbar library which decodes these barcodes. In the short term you might have more luck changing the distance at which you can the label (depth of field might change with focal distance, but I don't know whether it does) Sorry I can't do anything specific to help here other than to point you to http://zbar.sourceforge.net/ to request an enhancement, etc. |
Re: mbarcode
i remember an app that a friend had on his android device.
he scanned the bar codes from a cereal package, choc bar and all other kind of stuff, the device then opened a site that showed him all kind of information (nutrition info, price, where to get cheapest etc) will such connection be available für mbarcode too anytime? i tried scanning some codes, all i ended up with was the numbered code being shown by the program, if anything. |
Re: mbarcode
Write a plugin, it's nice and easy!
You could use the weblookup plugin to do a web search for the caode in question. I'm currently working (slowly) on an item database app which will perform auto-lookups and allow you to save items (e.g. lists of books, DVDs, shopping list), but going a bit slow atm due to work and broken N900. ItemDB in Garage. Help welcome :) |
Re: mbarcode
1 Attachment(s)
Thanks for mbarcode! I am writing a small Python plugin to manage my grocery list.
I ran into a problem however. When, in my plugin, I try to import some other python modules I get undefined references errors when the wrapper evals the code. For example, if I import datetime, I get undefined reference for _Py_ZeroStruct. I did some digging and it seems to be related to this bug: http://bugs.python.org/issue4434. It has to do with modules that use Python's dynamic loader not listing the dynamic loader as dependency. According to that ticket, it has been "fixed" in later versions of Python. I used the workaround listed in the ticket in your python wrapper (dlopen of libpython2.5.so.1) and it resolves my issue. You may want to include this in wrapper, at least until the python version on the N900 increases to a new version (if ever). I've included a patch for your convenience if you want to use it. Thanks again! |
Re: mbarcode
Nice one, I'll do some testing and add it in tonight :)
|
Re: mbarcode
Just a quick note to all plugin developers. The API has changed a bit, removing the isReady() function and replacing with a isReady() signal that is emitted whenever your plugin is ready to return some results. This avoids a bad timer we needed to use earlier.
This will cause some hickups for all who update mbarcode from extras-devel within the next 24 hours, but I'm trying to fix all errors as soon as possible. Please report back here if you find anything in particular. For those of you who are developing, you can see a sample plugin in the SVN repo using the new API: https://garage.maemo.org/plugins/scm...=maemo-barcode |
Re: mbarcode
Thanks for the reply! :)
One more question, for the stocktaking I need to scan barcodes and then add a number. Like a bottle of Jack Daniels with only half left I'd put 0,5 behind the barcode. I want to do this in excel for starters. Is there a plugin, or option that I've missed that will put the first barcode I scan in a predetermined cell (like always start in B6) and then the next one under it, etc etc? Or anything like it? I have no experience with programming but otherwise I'll have to give the API a shot. |
Re: mbarcode
I'd go for a Python plugin which has a numeric edit field that you can fill in, then just write the data to a csv file so you can import it into Excel.
|
Re: mbarcode
Updated Python plugin (with patch and Dragly's updated plugin api) will come this evening probably - I need to check whether signals emitted on the Python side are correctly received back in the C++ code, and if not will need to decide on a work-around.
|
| All times are GMT. The time now is 08:47. |
vBulletin® Version 3.8.8