Flashlight Firmware Repository

Yeah, I saw discussion about that. It would be nice, but it’s not the way Narsil works, and I don’t have the ability to re-flash the driver. :weary:

I have a general question about the modes in the firmwares.

I’ve read the code of several firmwares in the repository to understand how “multiple-clicks” function works for e-switches.

All of them had the same technique of counting clicks each time the button is not pressed and press-duration > 0.
So for the simplest UI of: 1 click = ON/OFF and 2-fast-clicks = TURBO :
When you double click (and the light is initially ON), first of all - the light turns OFF and then moves into TURBO mode.
Am I right or missing something?

What I don’t get is how do you distinguish a single click from multiple clicks? Because from what I can see, the firmwares in the repo, always run the code for 1-click, and when multiple-clicks detected, it’s code will run in addition to the 1-click code.

Thanks :slight_smile:

FSM solves that issue. Using this UI toolkit, it does not do the 1-click code before the 2-click code or the 3-click code… unless you specifically tell it to.

On some FSM-based interfaces, it intentionally goes to the 1-click level before going to the 2-click level, but it’s not a side effect. It only does that if it’s instructed to do so on purpose. Otherwise it’ll wait until the user is done clicking before it responds. For example, the Baton clone UI demonstrates both methods.

Thanks for the reference :slight_smile:
It’s an interesting implementation, ill test on my diving light soon

TK
I wanted to flash Anduril in my D4 with xpl-hi. But what does the lower muggle ceiling mean? I found it here

That was a one-off special build because someone requested a version with muggle mode limited to ~150 lm.

Thanks for this. This is exactly what I needed after I enabled some additional code in Anduril for dual switch support. I ran out of space and couldn’t make sense of the compile options I was missing in Atmel Studio. Now it compiles without issue!

Texas_Ace, were you ever able to suss out those problems with the GT70 style driver and Anduril? I’ve been researching a lot, and trying to find a way to get Anduril onto my GT70, but am not coming up with much information unfortunately.

Are Anduril inputs and outputs assigned to the same ports as Narsil and bistroHD?
Narsil:

bistroHD:

And Anduril?

Yes

Check the individual hwdef files to see how the pins are mapped for different types of hardware:

https://bazaar.launchpad.net/~toykeeper/flashlight-firmware/fsm/files/head:/ToyKeeper/

/* BLF GT driver layout
* ----
* Reset -|1 8|- VCC (unused)
* eswitch -|2 7|- Voltage divider
* AUX LED -|3 6|- Current control (buck level)
* GND -|4 5|- PWM (buck output on/off)

/* Emisar D4 driver layout
* ----
* Reset -|1 8|- VCC
* eswitch -|2 7|-
* AUX LED -|3 6|- PWM (FET)
* GND -|4 5|- PWM (1x7135)

/* Fireflies ROT66 driver layout
* ----
* Reset -|1 8|- VCC
* eswitch -|2 7|- optic nerve
* FET -|3 6|- 7x7135
* GND -|4 5|- 1x7135

As always very helpful. Thanks a lot!

I actually do have some experience in programming Arduinos but I am quite lost in the repository.
Could somebody point me out which files I would need to compile the code for the FW3A?

Sorry, it’s kinda buried. The top level of the code organization at Launchpad is branches. Normally everything is in the trunk branch, but that’s treated as a place for stable code to land. Development is done elsewhere. In this case, development happens in the fsm branch, and in other branches off of that one. So the fsm branch is a better place to check for the latest updates.

Within a copy of the repository though, the top-level directories are authors, and then the next level is projects. Anduril is part of the FSM project, also known as Spaghetti Monster… so the full path is ToyKeeper/spaghetti-monster/anduril .

It’d be a good idea to branch a local copy of the whole repository, in order to get all the files and preserve the directory structure. It’d also be a good idea to use the included build scripts, like typing “make” in the Anduril directory. Grabbing individual files tends to lead to problems, and building it with other tools works but isn’t really supported.

Sometime soon I really should merge everything back into trunk. It has been a while. I’m just waiting on some projects to finish first, because there are a bunch of changes which haven’t quite landed yet.

Thank You! I got it.
Next step ist to try to compile the code. Should not be to complicated on Linux, I think.

Compiling works now, but the code is much more complicated than I thought :weary:

Help with Launchpad and Bazaar in Windows?

If you feel that this post doesn’t belong here or is a repeat, politely let me know and I will move or remove it.

Scanning this thread indicates that getting the code has not been a problem for anyone else; troubles only seem to arise when trying to build or flash. Though not an expert, I can RTFM, build/compile from examples, and have a handful of programmers on hand when/if needed. Those tasks are not (yet) a problem, but getting the repo has been anything but simple for me.

I installed Bazaar standalone in Windows and added bzr to PATH.
I tried bzr branch lp:flashlight-firmware and got error saying I needed to authenticate. Thus, I went down a rabbit hole for hours…

I cannot accurately list all of the steps I’ve taken to get this working as I’ve forgotten the exact sequence (I did this in 2018-11), but at the very least I:

  • Signed up with Launchpad/UbuntuOne (OpenID)
  • Created/shared OpenPGP key
  • Signed Ubuntu Code of Conduct
  • Established Launchpad/UbuntuOne SSH key
  • Opened Windows command prompt:
    $ cd
    $ bzr whoami

    $ bzr launchpad-login

    $ bzr branch lp:flashlight-firmware
    Connected (version 2.0, client Twisted)
    bzr: ERROR: Connection error: Unable to authenticate to SSH host as
    @bazaar.launchpad.net
    supported auth types: [‘publickey’]
    $ bzr help stupidity
    bzr: ERROR: No help could be found for ‘stupidity’. Please use ‘bzr help topics’
    to obtain a list of topics.
  • Read LaunchPad documentation
  • Read Bazaar documentation
  • Pulled out my 3 remaining hairs.

I accept that I don’t understand Bazaar’s paradigm and grok Launchpad’s unique implementation even less, but even this idiot should be able to download a repo…

I’ve done some searching and scanned dozens of pages of this thread looking for help, but so far come up short. Is there a post that I’ve missed regarding the use of launchpad? I’ve been using git for a long time, but only locally so I’m not an expert. I’ve never before needed authentication just to get a repository. I assumed that repos were freely available as read-only. I don’t even understand why I need an authenticated SSH key to pull a repo :person_facepalming: .

TK put this on launchpad to make it easy to get. What am a missing?

I went through the same thing, and as far as I can remember, the crucial step was to run pageant (which is part of PuTTY) and load the generated private key into it. Then you can run the SSH session (in PuTTY, never tried it in a cmd prompt).

Yes, frustrating as hell, and it feels like a big FU to the windows plebs.

Because you might as well run Linux in a VM (which is a useful thing, by the way) and not be bothered with any of that when you pull a bzr branch. Just install the bzr package and it works. (Could be that *ubuntu has SSH set up by default, but still.)

Which is what I ended up doing anyways.

Thanks so much! It makes me feel a lot better knowing that other people have done this as I’ve been worried that none of this was necessary. Even TK has said that bzr branch flashlight-firmware is the easiest way to get the firmware. I’m sure she’s right if you type it from Linux :person_facepalming: .

I installed the key into PuTTY, but am then confused about how to run Bazaar from PuTTY. I did manage to do so once back in January, but no longer remember how I did it and I seem recall that I still had problems :blush: . I won’t ask for help with that as that’s surely something I can look up on my own. It seems odd to me that BZR knows my identity on the command-prompt, but does not negotiate the SSH session. I don’t understand the system and understanding is key.

[sigh] I’ve got Linux VM’s lying around, but I’m a fool that has always coded and flashed with Windows, so that’s what I wanted to do here. I’ve used Linux since first installing Red Hat in 1998 (and Unix since college in 1994), but have never truly moved; I’ve learned the hard way that dipping your toes into Posix from the comfort of Windows does not lead to mastery.

I thought that I was going about this entirely wrong, so your reply at least let’s me know that I’m not crazy. I will try to come at this from a Linux VM and see what happens. Thanks again!