Shop OBEX P1 Docs P2 Docs Learn Events
BadgeHacker Quick Loader available for #hackablebadge — Parallax Forums

BadgeHacker Quick Loader available for #hackablebadge

Hey all,

A while back we posed this question: http://forums.parallax.com/discussion/162392/need-a-quick-loader-and-downloader-for-hackable-electronic-badge

We found a developer (Propeller IDE programmer Brett Weir) and specified what we wanted in the tool. This tool has now been created and you can download it and try it for yourself at https://github.com/parallaxinc/BadgeHacker/releases

BadgeHacker is an open source tool that downloads firmware and allows for really fast configuration of your Parallax Hackable Electronic Badge. You can enter your name, make it scroll, turn on certain LEDs, and upload contacts that have been stored on your badge.

The first commercial user of BadgeHacker is the Serpentine Gallery in London. They're adorning many guests with the Hackable Electronic Badge as they walk into the door of the new Simon Denny gallery.

Let us know what you think!

Ken Gracey

Comments

  • I tried installing the Debian derivative deb(.deb) package, and it had a lot of errors, so it did not install. Maybe a little doc file is necessary to explain what each of the packages are, and if the .deb package needs other files to be installed first. Install instructions would be nice feature also.

    Ray
  • PublisonPublison Posts: 12,366
    edited 2015-11-17 14:29
    I installed the latest amd64.exe. Could not get it to communicate with the badge (incorrect firmware). It needs to have new firmware loaded. You can find it in the ZIP file under the SPIN folder. I included the binary here to be uploaded with the PropTool.

    All functions seem to be working on this platform. Pretty Cool!
  • Contact transfer works both ways between old and new firmware.

    What is the "send" icon supposed to do?
  • JonnyMacJonnyMac Posts: 9,105
    edited 2015-11-17 19:10
    I just made a firmware change to the badge this morning that will spawn a new version of BadgeHacker. I made a change in the way the contract information is transmitted from one badge to another which puts less stress on the IR transmit buffer. Works fine here in Hollywood, but I've only tested via terminal until BH is updated with this code.

    What is the "send" icon supposed to do?
    That sends your updated contact information to the badge. This may be redundant as I believe some of it happens on the fly. The command parser in the badge allows you to send items one element at a time or in groups.
  • JonnyMacJonnyMac Posts: 9,105
    edited 2015-11-17 19:38
    Just got the okay from Ken to post my latest code. This doesn't match up with the current version of BadgeHacker, but you can hack the date (then download to badge with Propeller Tool or PropellerIDE) and sort that out. The coms between BH and the badge have not changed in a few days.

    Jon
  • JonnyMac wrote: »
    Just got the okay from Ken to post my latest code. This doesn't match up with the current version of BadgeHacker, but you can hack the date (then download to badge with Propeller Tool or PropellerIDE) and sort that out. The coms between BH and the badge have not changed in a few days.

    Jon
    Will try it out.


  • Problem solved for the .deb distribution, you have to: 'sudo apt-get -f install'. I have not tried the program itself, that will be the next thing that I do. Since Jon is updating code, how will this affect the .deb distribution or other distributions?

    Ray
  • JonnyMacJonnyMac Posts: 9,105
    edited 2015-11-17 22:08
    If you change the DATE_CODE string to the the 14th (latest known to BH), you won't have any problems. You'll have to download via PropellerIDE because the image in BadgeHacker is older. If BH sees the current date it moves right along uploading you information. Note that I've only run the Windows version of BH, but I did this morning with my latest code (with 17 changed to 14 as I just mentioned).

    FWIW, over the holidays I'm going to attempt my own badge GUI that is a very simple replacement for the terminal interface. BH is actually quite complicated under the hood, and I want something simpler to play with for myself (though I don't mind changing things through a terminal).
  • JonnyMac wrote: »
    If you change the DATE_CODE string to the the 14th (latest known to BH), you won't have any problems. You'll have to download via PropellerIDE because the image in BadgeHacker is older. If BH sees the current date it moves right along uploading you information. Note that I've only run the Windows version of BH, but I did this morning with my latest code (with 17 changed to 14 as I just mentioned).

    FWIW, over the holidays I'm going to attempt my own badge GUI that is a very simple replacement for the terminal interface. BH is actually quite complicated under the hood, and I want something simpler to play with for myself (though I don't mind changing things through a terminal).
    What graphics library will you use to make your simpler badge GUI? Qt is nice but, as you say, it is quite complicated and makes large executables. I'd be interested to hear about a leaner alternative that is cross platform.

  • JonnyMac wrote: »
    Just got the okay from Ken to post my latest code. This doesn't match up with the current version of BadgeHacker, but you can hack the date (then download to badge with Propeller Tool or PropellerIDE) and sort that out. The coms between BH and the badge have not changed in a few days.

    Jon

    Verified, change line 145 to 14 NOV an all is fine.



  • Well, and as quick as that there will be another change coming. Brett asked me to change the response to PING (undocumented feature that BH uses) such that BH can know features and protocol -- this will let us expand in the future. There was also an issue to one of my object references; I always use lowercase names for objects but the OLED driver (which is the only thing we're using I didn't write) uses mixed case (please, don't do that) for its name. One Windows that's not a problem, on other OSes it can be.

    Anyway, expect another BH update shortly. I'm not going to post it because the changes are so small and BH has to be modified to deal with the new PING response.
  • What graphics library will you use to make your simpler badge GUI?

    I'm thinking of using this project as a means for learning B4J (BASIC for Java). I don't program in C well enough, nor understand how to us Qt, so I'm taking a whole new road.
  • David BetzDavid Betz Posts: 14,516
    edited 2015-11-18 01:29
    JonnyMac wrote: »
    What graphics library will you use to make your simpler badge GUI?

    I'm thinking of using this project as a means for learning B4J (BASIC for Java). I don't program in C well enough, nor understand how to us Qt, so I'm taking a whole new road.
    I program in C and C++ well enough but I'm finding it challenging to understand Qt anyway. Currently, I'm having fun trying to learn how to setup separate threads. :-)

  • I had a chance to run the program, with a Linux derivative, and glance at the source folder, interesting concept. Not sure what you are supposed to do with LED selectors though.

    On mine, doing a trial run, I keep getting 'Simon Denny' to appear, I guess somewhere along the line that will disappear. The nearest I can tell, with this version, you can place a name on your badge, and maybe have the badge send your selected data to another badge. Since I have two badges, I never got the send part to work between the two badges, I assume it is supposed to be auto magic.

    Also when you plug in, and have the BH program running, I thought that the program would load up with the name that is on the badge, and then given a choice to update the specific database file with new contact information, if the badge was exposed to another badge that was handing out information.

    Any insight as to where this program is heading, feature wise?

    As for the BH program internals I see it is all in Spin, but I did not see where and when openspin.xxx got loaded, I assume that is how the badge gets programmed? Since BH is using QT, why didn't it just use all the programs in a C format as opposed to using Spin and C?

    Ray
  • JonnyMacJonnyMac Posts: 9,105
    edited 2015-11-18 15:06
    Since BH is using QT, why didn't it just use all the programs in a C format as opposed to using Spin and C?
    As you're way out of the loop on the history of these projects, let me try to clarify things. There are two distinct projects: 1) Badge code written in Spin/PASM by me, and 2) the BadgeHacker GUI written in C using Qt by Brett Weir.

    The badge code came long before the idea of BadgeHacker. I was asked to write the badge code, and as I don't write in C, I chose Spin, the native language of the Propeller. I translate interesting C code to Spin all the time. I'm going to live on the assumption that any person claiming to be a C programmer can translate my badge code to C. In fact, I think Andy Lindsay has a port of the original code (pre serial commands).

    After Parallax released the badge they were contacted by a non-technical client for an event. Ken asked me to add the ability to change badge information without having to download new code. I did this by adding my parser object which "listens" to the serial port and processes known commands. If you connect a terminal at 115200 baud you can do this:

    NSMSG Jon McPhalen

    This will set the non-scrolling message (badge name) to my name. If you want to add spaces and other non-alphanumeric characters you need to put them in quotes -- like this:

    SMSG "Jon McPhalen" "I Wrote The Badge Code"

    This will change the lines in the scrolling message. To activate scrolling you would type:

    SCROLL YES

    You can find all the details of the parser commands in the Spin source code -- including one that's not documented in the Help output to the terminal (PING). After the parser was installed and working through a terminal, Ken asked me if it would be possible to create a GUI for people that don't visit these forums could use with the badge. I told him it was possible, we just need to have a GUI that will send the same things we can type into a terminal. I have in fact done this with simple Android apps controlling a Propeller on the DEF CON 22 badge that has been hacked with a Bluetooth radio. As Brett Weir is writing the x-platform PropellerIDE program, he was the natural person to ask about creating the BadgeHacker GUI. For the last couple of weeks Ken, Brett, and I have worked closely to make sure that it all works as smoothly as we can make it.

    Not sure what you are supposed to do with LED selectors though.
    This lets one light the badge as they please. The user LED status is maintained between power cycles and returns after then logo demo. It's just decoration. That non-technical event I referenced had to do with an art gallery.


    Hopefully this sheds a bit of light. The badge was originally created for people like us who jump head-first into programming. Non-programmers wanted to put them to use so we added a parser that one can use to change badge text through a simple terminal. Finally, the BadgeHacker x-platform app was created so that non-technical types didn't have to go looking for a compatible terminal.

    I hope that clarifies things. It's open source for a reason. Jump in a create your own versions!
  • Thanks Jon for the insight. I am really surprised that there is isn't more threads here about using the Badge. I thought by now we would have all kinds of programs that were dealing with the Badge, but maybe that is still coming up.

    After I did some initial programming using PropGCC, and the Badge, I came away with the feeling that using an App approach could be a way to go, instead off having to create specific programs every time you wanted to do something with the Badge, over and over again. Need something that is a little more automated. I did not even get into the gathering and transferring of data between the Badges, I need a different way to go with that, again changing the initial program, again and again is getting tiresome.

    You mentioned B4J, so I downloaded that, and installed it on my Win 7 box, now I will see how far I can get with, going the Java way. I was also surprised that the Aps that are created, can be run on Linux and other platforms. I remember back a few years ago when jazzed was working with QT and providing source for SimpleIDE, I looked at the QT platform and found that very difficult to deal with. I hope B4J does not turn out the same way.

    I am glad that this thread came up, now it has brought up some interest for me, and maybe I will have to finish up what I started before. Thanks again.

    Ray

  • Ray,

    I was trying to follow your other threads dealing with battery and such in C, but I was having such a problem setting up SimpleIDE.

    I don't do C, but I want to learn. I am going to have to delete all instances of SimpleIDE and do a new install.

    I am looking forward to trying your and Andy's programs.

  • The latest badge code has a battery measurement method that you may find helpful. We're not using it at the moment, because we have to quantify RC timing with battery voltage.
  • Jon and Brett,

    You guys have done some amazing stuff with the badge and GUI. I am impressed.
Sign In or Register to comment.