maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   mbarcode (https://talk.maemo.org/showthread.php?t=34996)

lardman 2010-06-04 16:52

Re: mbarcode
 
And I'm going to try to get python plugins working on Sunday afternoon.

Quote:

barcode or QR code are both ok.
I was just curious as there are many different types of 1D code and the 2D codes can explicitly say which app/plugin they want to handle them depending on what text they contain.

What are the specifics of your application? Do the barcodes already exist on whatever you're scanning (in which case you should know exactly what they are, or can give us an example image) or are you doing some sort of proof of concept and therefore can choose whatever you want?

thp 2010-06-04 17:14

Re: mbarcode
 
I'd like to write a plugin that can handle URLs to .deb packages that will download the .deb to a temporary location and then open the .deb with Application Manager (after a warning if the .deb comes from a non-repository location).

Also, the same plugin should be able to handle text/data that just describes a package name and downloads and installs it from the repository using the Application Manager (what's the best way to "encode" information like this and have it detected by mbarcode as a package name?).

Someone could then provide a web interface to generate such QR codes and publish them on the application web pages (maybe we can even get these "app codes" integrated into maemo.org/downloads).

This is a well-known technique for installing apps in the Android world, and I think it would be a nice way of quickly "discovering" apps on Maemo, too.

lardman 2010-06-04 19:00

Re: mbarcode
 
Indeed, glad someone else is interested in this. I saw the very same feature in Android and in the old GTK+ version of mbarcode, wrote the QR code plugin so that it could accept either an entire .install file encoded as a QR code barcode (but those were then pretty large) or just the url to a .deb/.install file which is (theoretically, and at least did work iirc) automatically handed over to the relevant program to be downloaded and handled.

Anyway I'm all for this, I guess that encoding a url or the name of a deb, rather than the entire .install file would be a better way of doing this, just as the QR code barcodes are then smaller.

I'm open to suggestions and opinions as to formats, etc.

gri 2010-06-04 19:18

Re: mbarcode
 
Example format of Android QR code:
Quote:

market://search?q=pname:com.company.program
I think providing only the package name and repository (extras, extras-testing and extras-devel) in the code would be enaugh and won't need that accurate captures :)

If only the application manager wasn't that slow ...

thp 2010-06-04 20:07

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 699985)
Anyway I'm all for this, I guess that encoding a url or the name of a deb, rather than the entire .install file would be a better way of doing this, just as the QR code barcodes are then smaller.

I'm open to suggestions and opinions as to formats, etc.

The URI schemes page on Wikipedia has an entry for "apt:", which is used at least by Ubuntu AFAIK. So, "apt:<packagename>" would be really short for packages that are in Extras. Maybe we could also special-case the situation where <packagename> is not in Extras (and check for Extras-Testing/-Devel and ask the user with a big, fat warning if (s)he wants to install unstable software?).

For "single deb" installation, we could either detect ".deb" at the end of an URL and assume it's a package (maybe asking the user first) or "invent" some pseudo-URI-scheme (e.g. "dpkg://", which will be used to "detect" an installation request, and "dpkg://" will be replaced by "http://" before trying to download the package - "dpkgs://" could be used for https:// URLs).

Or maybe we leave the single-.deb option completely out of this as an incentive to get apps into Extras and just go with "apt:" URIs?

We could (if we wanted) support repository information by adding the parameters at the end of the "apt:" URI, e.g.:

apt:feedingit?url=http://repository.maemo.org/extras-devel/&distribution=fremantle&components=free%20non-free

dragly 2010-06-04 20:14

Re: mbarcode
 
Actually, the first lines of most install files contain exactly the package name and the repository name. If we take Personal IP Address as an example:

The install file contains this:
Code:

[install]
catalogues = extras
package = personal-ip-address

[extras]
name = Maemo Extras
uri = http://repository.maemo.org/extras/
components = free non-free

We could make probably cut the install file down to this:
Code:

[install]
catalogues = extras
package = personal-ip-address

And make it so that when the catalogue is not defined, the application tries to fill in the missing info for a set of known catalogues (extras, extras-testing, extras-devel etc.) and then uses the install file as always.

This minimal install file format is almost the same size as the URL to the file.

The URL is encoded like this:
http://qrcode.kaywa.com/img.php?s=3&...et_installfile

While the "minimal" install file is like this:
http://qrcode.kaywa.com/img.php?s=3&...nal-ip-address

Doing it the "Android way" is by far the most efficient method. This is
Code:

install://extras;personal-ip-address
in QR Code:
http://qrcode.kaywa.com/img.php?s=3&...nal-ip-address
I'm not sure if we should bring in a new format just to make the size smaller? Or to create a special URI? Reusing the data from the install file is maybe easier to make it work with the downloads section.

Using the web interface from Kaywa is quite easy by the way, and is probably a good start until someone creates a tool specifically for Maemo.

@thp: If you want to do that, please feel free to have a look at the qr-plugin source code. I think the easiest way to do what you want is to implement (patch) it into the qr-plugin rather than making a new one :)

dragly 2010-06-04 20:23

Re: mbarcode
 
@thp: I had completely forgotten about apt! That's probably the best idea yet. It actually has kind of a spec for repositories as well, just check out the apt URI for flash on Ubuntu:
Code:

apt:adobe-flashplugin?channel=$distro-partner
I'm not sure where to find the full spec for apt URI's, but this format is for sure simple enough - and we're not reinventing the wheel :)

dragly 2010-06-04 20:38

Re: mbarcode
 
Quote:

Originally Posted by thp (Post 700073)
Or maybe we leave the single-.deb option completely out of this as an incentive to get apps into Extras and just go with "apt:" URIs?

I at least believe that we shouldn't create a new URI standard just for debs. It is clearly for the best to get as many packages into repositories in general (because of updates etc.), and into extras especially. Having a simple parser for deb-files could be a good idea, although not all deb-links contain ".deb" (because of redirection etc.).

thp 2010-06-04 20:48

Re: mbarcode
 
1 Attachment(s)
Attached is a very basic patch that should get you started, some things are still missing and need to be filled in. Untested, probably full of bugs, it might not even compile and you could overwrite important files (no error checking, etc..). It also does not open the generated .install file yet. Can you fill in the missing pieces? :)

lardman 2010-06-04 21:20

Re: mbarcode
 
We need to check whether the Hildon mimehandler handles apt: uris, if it does then all's well and good and we don't even need to change the plugin (or at least not significantly, i.e. a one liner, iirc).

lamle 2010-06-05 13:52

Re: mbarcode
 
Hi,
Thank you very much Dragly and Lardman for helping me out.
Quote:

Originally Posted by dragly (Post 698417)
The other solution is to copy the VideoWidget, BarcodeDetector and decoder classes from mbarcode and implement these statically in your application. mbarcode is open source, after all :) The problem with this solution is that you will have to update your application with changes in mbarcode if you want to stay up to date with the latest bugfixes etc.

Using your advice I have successfully embedded that mbarcode reader to my application and it works just like the way I expect to have.
Thank you all again.

dragly 2010-06-05 17:37

Re: mbarcode
 
That's great! Good luck with your application and your thesis ;)

lamle 2010-06-10 22:51

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 699243)
mBarcode is licensed with the GPL license, meaning that you should release your application with the same (or compatible) license if you copy code from mBarcode. In other words, you should make your application open source as well, if it is not already GPL-licensed.

Actually I am doing this as a thesis and for my company also and now when I got it running, this license thing should be considered seriously. If I want my application to be commercial, what should I do now?

dragly 2010-06-10 23:30

Re: mbarcode
 
Quote:

Originally Posted by lamle (Post 709619)
Actually I am doing this as a thesis and for my company also and now when I got it running, this license thing should be considered seriously. If I want my application to be commercial, what should I do now?

You could release your application commercially right now if you like to, but you have to make the source code available as well. The buyers/users of your software must also be informed that they may receive the source code on request. And your application should contain a file named "copying" or "copyright" containing information about the license and the authors of the different parts of the application, including mbarcode and libraries like zbar, libdmtx, etc.

The easiest way to make the code available is to host it somewhere like Garage or Github.

The GPL license does not require you to give away the binaries (the compiled application) for free, even if the source must be available free at charge. This means that you are in a perfectly fine position to make money from your application even if it is open source :) The GPL license does not have any restrictions on commercial usage other than that the source code must be available. So feel free to commercialize your application ;)

I don't remember exactly everything that the GPL license requires, so if you are unsure about anything, check the GPL FAQ or have a look at the license text.

Licensing the code from mbarcode "commercially" as in removing the GPL requirements is more likely a big project. First of all we would have to gather consent from all contributors to mbarcode (at least those whose code is still in use), and we would have to get consent from the developers behind libdmtx, which is also licensed as GPL. A lot of people have put an effort into this and I don't think they (including me) will license it commercially without getting some kind of compensation.

The reason why GPL is chosen by most people (again, including me) is its strength to make sure that when someone builds upon what you've created, the changes which are made are shared so that others can build upon that again.

lardman 2010-06-13 10:13

Re: mbarcode
 
I've finally found some time to do some hacking on my itemdb plugin (not much mind you, but I've started adding some code and files to svn).

The idea is to do the following in the plugin:

Present summary of the item info (from interweb, via other plugin prefreably), and simultaneously search the database tables in itemdb to see if it's already present.

Allow user to save that information into a table (or create a new table), or if it's already present, allow them to manipulate it (move, delete, etc.)

The point being that a user could have tables for Books, CDs, DVDs they own, ones they want (i.e. wishlists) and ones that they have loaned out perhaps. I suppose we could also expand this to a grocery/generic shopping list type plugin without much effort if that's of interest to people.

Anyway that's the plan, if anyone has any thoughts/ideas/offers of help, then please go for it :)

lardman 2010-06-15 22:15

Re: mbarcode
 
I now see those green/pink/purple flashes you were talking about - it appears that the pipeline is getting messed up and sending us a frame or two of plain YUV data (i.e. it has the correct layout, Y 1/2 frame size, U/V 1/4 size) but with colour applied.

No idea why, but it's to do with the autofocus. I used to see this when I started the pipeline up in the GTK+ version. If anyone has any ideas as to how to purge/prime the pipeline after performing the focusing to avoid these erroneous frames being sent down do please speak up :)

fwiw I've tried setting the pipeline to both NULL (goes randomly full screen when restarted, still has the artefacts) and READY (artefacts still there) rather than just PAUSED before the autofocus routines are invoked.

notay 2010-06-16 14:29

Re: mbarcode
 
Hi,

How do I install this application on my N900?

Thanks.

gidoca 2010-06-16 14:40

Re: mbarcode
 
Quote:

Originally Posted by notay (Post 717612)
Hi,

How do I install this application on my N900?

Thanks.

Enable the Extras-Devel repository, then install it from the application manager. But be aware that software from Extras-Devel may cause problems.

notay 2010-06-16 14:45

Re: mbarcode
 
I have enabled it but when I try to download mbarcode it says;

'Unable to install 'mbarcode'. Some application packages required for the installation are missing.'

lardman 2010-06-16 19:46

Re: mbarcode
 
Which packages does it say are missing? Have a look at the details (there's a button with the same name iirc).

notay 2010-06-16 20:48

Re: mbarcode
 
Unable to install 'mbarcode'
Application packages missing: libqt4=cpre (>=4.6.2~git20100224-0maemo1+0m5)

lardman 2010-06-17 09:18

Re: mbarcode
 
Have you upgraded to the latest firmware release?

notay 2010-06-17 09:40

Re: mbarcode
 
I think I have, how do I check?

lardman 2010-06-17 11:08

Re: mbarcode
 
Settings > About Product, should show version number 10.2010.19-1 (not sure if the -1 will be the same for everyone)

notay 2010-06-17 14:57

Re: mbarcode
 
mine is Version: 2.2009.51-1.205.1

Rob1n 2010-06-17 15:03

Re: mbarcode
 
Quote:

Originally Posted by notay (Post 719280)
mine is Version: 2.2009.51-1.205.1

You've got the Vodafone firmware then, and they've still not released the PR1.2 update. I'd recommend reflashing with the generic UK firmware instead, otherwise you'll be lagging behind at every firmware release.

notay 2010-06-17 15:49

Re: mbarcode
 
Quote:

Originally Posted by Rob1n (Post 719292)
You've got the Vodafone firmware then, and they've still not released the PR1.2 update. I'd recommend reflashing with the generic UK firmware instead, otherwise you'll be lagging behind at every firmware release.

How do I do that? I am a noob at this.

Rob1n 2010-06-17 15:56

Re: mbarcode
 
Quote:

Originally Posted by notay (Post 719357)
How do I do that? I am a noob at this.

See the instructions here - you shouldn't need to flash the eMMC, just the firmware. And make sure you do a backup first, just in case.

notay 2010-06-17 19:10

Re: mbarcode
 
Thanks, i'm following this;

1. Download and install the latest version of Flasher e.g. maemo_flasher-3.5_2.5.2.2.exe
2. Download the latest firmware (.bin) file and save it to %ProgramFiles%\maemo\flasher-3.5\ (the default installation path for Flasher) or to the custom path of your choice.
3. Ensure the battery is at least half full.
4. Unplug charger cable and switch off the device.
5. Open the Command Prompt (Start then Run or Windows Logo key + R) and type cmd then press Enter.
6. Change the directory to the Flasher's path (TIP: Use the TAB key to auto-complete the commands and file-names)

cd "%ProgramFiles%\maemo\flasher-3.5"

7. Hold the u key on the device keyboard and connect the USB cable at the same time (see the Flasher documentation)
8. Run the following command:

flasher-3.5.exe -F RX-51_2009SE_2.2009.51-1_PR_COMBINED_MR0_ARM.bin -f -R

Replace RX-51_2009SE_2.2009.51-1_PR_COMBINED_MR0_ARM.bin with the firmware you wish to update (The name of the firmware image file you downloaded in the beginning).

After I run number 8, nothing happens. Any suggestions?

lardman 2010-06-17 20:15

Re: mbarcode
 
I'd run the command before attaching the USB cable, and rather than using their instructions would ensure that the device is not connected to anything (usb, power), power it down, then just plug in the usb cable (and it will automatically boot to flashing mode).

We are going OT here though, you may get more views (and therefore more people who've seen your problem) with a new thread specifically about the flashing question (with a title to match). I only use Linux to flash for example, so am just going from what I do there.

Geekworld 2010-06-17 23:59

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 719736)
I'd run the command before attaching the USB cable, and rather than using their instructions would ensure that the device is not connected to anything (usb, power), power it down, then just plug in the usb cable (and it will automatically boot to flashing mode).

We are going OT here though, you may get more views (and therefore more people who've seen your problem) with a new thread specifically about the flashing question (with a title to match). I only use Linux to flash for example, so am just going from what I do there.

Hi Lardman,I had installed ur appliation,but after scanning a barcode,it is not giving me any results????????

lardman 2010-06-18 13:27

Re: mbarcode
 
Did it produce a number/text from the barcode?

Could you send a photo of the barcode?

Note to self, must finish that bit of the app so people can submit problematic barcodes for us to look at!

lardman 2010-06-24 09:40

Re: mbarcode
 
Just a FYI (and reminder to get people to kick me if I don't do more), I've made some changes to the SVN code and we should probably go for a new point release.

The only visible change is probably adding the ability to save scan history and restore it (i.e. the thumbnails you can click on the RHS). I've also added a numeric editor in the Settings menu so you can change the continuous autofocus delay time.

Under the skin I've cleaned up the implementation of the history thumbnail list, added a checkbox to the Settings menu to enable/disable this feature, stopped timers from running unnecessarily (i.e. if there's no scanning and/or no autofocus going on).

Things to do now:

Work out why the Settings menu doesn't seem to recognise changes to e.g. the autofocus length (but they are saved and acted upon - just not shown in the dialog if you open it again - odd!).

Change the way the thumbnails are taken from the pipeline - atm (iirc) the thumbnail displayed is the last frame sent down the pipeline at the point one of the decoders detects a barcode. As the decoders are in a separate queue (i.e. thread) which can drop frames, this means the displayed thumbnail is probably different to the frame that was decoded. This is a hangover of the previous decoding method (not using Gst elements, but using memory buffers directly), which works well enough for many cases, but not all and therefore I will fix it.

Along the same lines, we should give the user the option of saving any barcode that cannot be decoded so they can send it in and we can look at the problem. Not sure how to do this - perhaps present a dialog after scanning for X seconds, or use a button to "Save Frame" during scanning. Will have to think about it.

Fix the green/purple fringes. This is especially problematic with the continuous autofocus, as every time the pipeline is paused, this is what comes out and it has to be paused to carry out the autofocus. Not sure what's causing this, will have to do some digging into the autofocus to see if it e.g. changes the camera output format and then we get junk left over when the pipeline is restarted, or to see if I can purge the pipeline before the restart. Any help/ideas appreciated :)

Pop up menu to delete individual history list items (atm you can clear all using the menu, but you might just want to get rid of one or two), I was thinking of a long press to open a context menu with a delete (and perhaps a save) item.

Add in Python plugin support. Any help appreciated here too as I've not used PythonQT before - has anyone compiled it already for example?

Finally, get back to writing my itemdb plugin.

Thanks for listening :)

WorldKaoss 2010-06-25 01:19

Re: mbarcode
 
Hi guys. I've installed this from the extras-devel but it isn't working for me.

I mean, it's intsalled, no errors, but I can't find it as an application, nor as an extension (in the file manager for photos; in the photo/video shooter; in the settings area)

I thouhgt this is a bug so I restarted the device, but it's the same.

I'm running the 10.2010.19 firmware thingy.

Any help? Thanks

lardman 2010-06-25 07:00

Re: mbarcode
 
Odd, it should appear as an application in the launcher menu (and does for me).

It doesn't appear as an extension in the camera app and is not linked into the filemanager I'm afraid.

Are you sure it installed? Can you run it from the terminal?

WorldKaoss 2010-06-25 09:38

Re: mbarcode
 
I'm sure it's installed (and it doesn't appear when I search for it on the "Download" section the App. Manager).

How do I run it from terminal? ("mbarcode" ?)

WorldKaoss 2010-06-25 10:57

Re: mbarcode
 
nevermind, for some reason now it appears in the application list and it runs.

from time to time it starts flashing the flash at 1-2 second intervals and the top-half of the imagescanner flasher to green+yellow .. I think this problem is causing by the YUV renderer on computers too.

lardman 2010-06-25 11:39

Re: mbarcode
 
Quote:

Originally Posted by WorldKaoss (Post 728808)
nevermind, for some reason now it appears in the application list and it runs.

Good :)

Quote:

Originally Posted by WorldKaoss (Post 728808)
from time to time it starts flashing the flash at 1-2 second intervals and the top-half of the imagescanner flasher to green+yellow .. I think this problem is causing by the YUV renderer on computers too.

The autofocus is set to run every 1.5s iirc, if it can't get a good focus you see if running (and it uses the flash if the light levels are too low). Try setting the autofocus delay to something longer (3.5s perhaps) to give the decoder a chance to detect something between the autofocus events.

Re the odd colours and "multi-views" you see at that point - it does look like a YUV layout, almost as if 3 frames of YUV have been pushed into the pipeline and then interpreted as RGB (though I've not looked at the formats, so this interpretation may be completely wrong).

The question is how to get rid of it? If it's a problem with the format conversion (the fact that it happens between autofocus and the pipeline restarting; or that the conversion element gets confused) it would be possible to move to using an RGB pipeline.

Alternatively I wonder if we can purge the pipeline and the element states to avoid major changes?

I'll have a look at it next week when I have an hour or two to work through some ideas.

msa 2010-06-25 11:59

Re: mbarcode
 
so this app has been in devel for how long... since 2009?

will it ever come to extras? :P

lardman 2010-06-25 13:32

Re: mbarcode
 
It's not exactly production quality yet what with the missing Python plugin functionality and video artefacts. I've been rather busy for the last 6 months so haven't had an awful lot of time to try to get things finalised, but am working on it.

It's certainly usable though, so give it a go. Patches welcome of course so we can get it into Extras proper asap! ;) :)


All times are GMT. The time now is 08:47.

vBulletin® Version 3.8.8