E-switch UI Development / FSM

To completely disable it, compile with something like this in the config file:

#undef USE_THERMAL_REGULATION

Thanks, I might have to do that, was just hoping for a quick fix without having to take it apart.

Otherwise, get it hot, calibrate the sensor to tell it it’s only 1 degree, and set the ceiling as high as it can go… 70 C or 40 clicks. That should give it a lot of headroom.

Not guaranteed to completely disable regulation, but it should at least reduce the chance of ever stepping down.

Yeah, not worried about it never stepping down, it just steps down way too much right now.

I have now tried to get a new version of Anduril built

Problem No. 1 is that all the code is totally exploded with Java

Its so bad even Atmel Studio crashes, not even to think to get that anyhow converted to be compatible

Looks like Atmel Studio bug.

Using your Atmel project, with last Anduril.c. All works. Must be your soft go mad

seems save file as in the firmware trunk with right click does add HTML Java code
id the download button pressed only the Atmel code downloaded

Lexel, I don’t see any Java in your screenshot. Just HTML because you’ve saved the page instead of the file. Also please note that Anduril is not a single source file. It consists of multiple files in several directories. Use bazaar to clone the code and you won’t have such issues.

Now the firmware seems to blink out 28.9°C as 2 8 9 I don’t like, the MCU is very imprecise even when the room temp is set
it’s a wast of time to try to blink out another digit

It looks like you saved a web page as a .c file and then tried to compile it. Please use bzr instead, if at all possible. You’ve had quite a few issues due to downloading source files individually instead of using the revision control tools it’s meant to be used with, and using the right tools would avoid a lot of headaches.

It doesn’t try to track or display fractional temperatures. The function which blinks out numbers has an 8-bit unsigned integer for its parameter, so the highest value it can display is 255. If you saw 289 I suspect the problem is user error of some sort.

[quote=ToyKeeper]

Its blinking out 3 numbers now instead of 2 with latest build I downloaded
I have even seen at first numbers of >400

Temp blinks 23.8 and 24°C of Anduril the latest build

Again, it’s not doing a decimal point. It’s an 8-bit unsigned integer. The values go from 0 to 255.

The temperature itself is a 16-bit signed integer, which can go from –32768 to +32767, but the display function can only do 0 to 255. That means only the lowest 8 bits are displayed. If it says 238, either it thinks it is running at 238 C, or more likely, –18 C. Or some other number between –32768 and +32767 which happens to have the same bottom 8 bits.

Or it could be a mismatched version of the code again, including some of the recent changes but not others, which could easily lead to all sorts of strange behavior.

Does anyone have a ready to roll atmel studio project using the newest code they’d be willing to share as a .zip?

I’ve just been downloading precompiled hexes recently but now I need to make some code changes so I took a look and there’s TONS of changes everywhere from the older early summer version my atmel studio project was last based off of.

still got that strange temp readout even after adding all newer file revisions to the project after flashing
after setting the value it seems to work

Only D4v2 is not building it gives me a bunch of errors, likely because of new MCU

The build has been getting more complicated over time, harder to make it work inside Atmel Studio. It simply isn’t designed for the sort of things being done in this code, like having a bunch of build targets which are detected at compile time by the file names.

Depending on your setup, it might be easier to use WSL (Windows Subsystem for Linux) instead of Atmel Studio, so you can use the same development tools it was made with. It basically makes a virtual container running a Linux distro. Either the Ubuntu or Debian flavors should work. From there, the instructions in the README file should be useful.

Because most flashlight users here can’t use command line Linux stuff

My question is:
Why isn’t it possible after some major updates that you get a working AS7 project uploaded, maybe 3-4 times a year
You are familiar with all that coding, instead some members have to try it on their own to get it somehow working, often messing it totally up

I will say that once TK posted setup instructions for linux, I was able to get it working in a Mint virtual machine (there were like 4 or 5 command lines commands you copy / paste). Things basically just worked.

I had to lookup a few commands for BZR and some other stuff that would be nice to add to the setup guide but overall once it was all figured out, I got a copy of the repo made locally and everything compiles fine using the scripts she includes in the repo.

Now anytime I need to get a new version, I can’t really figure out how to merge, so I just delete the old repo copy and download a new one, not the correct method but it works. Just kinda sucks to re-make any changes I have made.

It shouldn’t take 2 hours to get the latest code. It only requires one quick command to pull updates in a local mirror of the upstream branch. Setting that up the first time is pretty quick:

cd src/flashlight-firmware
bzr branch lp:~toykeeper/flashlight-firmware/fsm
cd fsm

Then whenever you want to grab the latest updates, go to that directory and run “bzr pull”.

To do actual development, it should be in a different branch. For that, try something like “bzr branch fsm myproject” and then work inside the “myproject” directory. And if you want to merge changes from upstream, do something like “cd myproject ; bzr merge …/fsm ; bzr commit”.

That was changed last year.

So if I understand correctly, you’ve been using code from 2018 this whole time, mixed with some code from 2019? No wonder it’s not working.

Edit: If it helps put things in more familiar terms, the LT1 lantern driver is up to version 5.1 now. But imagine if I built a circuit using the solder mask from v2.0, the drill holes from v3.0, the ink markings from v4.3, and the copper pours from v5.1. Even if the factory was able to print it, I would end up with a PCB which doesn’t work.

Someone who is able to design a PCB should also be able to type a few commands in a terminal. It’s really not that hard. A Linux OS makes it easier, of course. And modern Linux systems are easy to install and use. Just try to install an Ubuntu in a virtual machine, forward the programmer USB device and follow the official instructions.