News:


Advertise Here

  • May 23, 2022, 08:34:10 AM

Login with username, password and session length

Author Topic: UPDATE v1.2: Low Cost Open Source Timer  (Read 1165 times)

Online CircuitFlyer

  • Trade Count: (0)
  • Commander
  • ****
  • Posts: 241
    • www.circuitflyer.com
UPDATE v1.2: Low Cost Open Source Timer
« on: May 29, 2021, 09:42:58 AM »
FYI - I have made some revisions and updated the code and instructions for my open source DIY low cost control line timer called the Touch_and_Go. Here is the link to the project - https://circuitflyer.com The button to download the files is at the top of the web page and the link to the instructions is at the bottom.

This update fixes a glitch I found when switching between different programming modes.

I also added a slightly higher minimum throttle setting to help some ESC's arm better. Unfortunately, if you are upgrading from a previous version this change will cause a slight increase in your saved RPM. So. before your next flight, double check your RPM setting. You may have to bump it back down a notch or two.

I also grouped some of the important variables together in the code so they are easier to find. This is only if you wanted to change the values assigned to the variables to better suit your needs.

If you have previously built some timers and want to update the program, you only have to replace your current version of main.py with the newer 1.2 version. main.py is the only file that has been updated all other files in the download are the same. Remember to touch and hold the sensor pin for about 4 seconds during boot up when you connect the USB cable. This is required to permit write access to the board memory from your computer so you can overwrite and save the new main.py file.

Paul
Paul Emmerson
Spinning electrons in circles in Mississauga, Ontario, Canada
Low Cost DIY Control Line Timer - www.circuitflyer.com

Offline RogerGreene

  • 21 supporter
  • Trade Count: (0)
  • Commander
  • *
  • Posts: 364
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #1 on: July 09, 2021, 06:08:34 PM »
Hi Paul,

I am trying to up-date to new v1.2 by copying all or just the main.py file, however, the file is write-protected. I did a Ctrl-A to then hit the delete key, but that didn't work What now?

Roger Greene

Fly Stunt <><
AMA 435R
USAF Veteran 1962-66 SAC
Life is 10% what happens to you and 90% of how you react to it. FAA #FA3RFLPAN7

Online CircuitFlyer

  • Trade Count: (0)
  • Commander
  • ****
  • Posts: 241
    • www.circuitflyer.com
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #2 on: July 10, 2021, 01:13:46 PM »
Roger,

You just need the new main.py for the update. Hold you finger on the touch pin as you plug in the USB cable and continue to hold it for another 4-5 seconds as the board boots up. This will allow access to the files from your computer.

A normal boot up, without holding the touch pin, only allows access to the files from within the program code. The board manufacturer doesn’t let us access the files simultaneously from the computer and from within the program. If both happened to try and write to memory at the same time bad things could happen. Thus, we have to select one way or the other as needed.
Paul Emmerson
Spinning electrons in circles in Mississauga, Ontario, Canada
Low Cost DIY Control Line Timer - www.circuitflyer.com

Offline Avaiojet

  • 22 supporter
  • Trade Count: (0)
  • Admiral
  • *
  • Posts: 7966
  • Just here for the fun of it also.
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #3 on: July 10, 2021, 04:39:33 PM »
Roger,

You just need the new main.py for the update. Hold you finger on the touch pin as you plug in the USB cable and continue to hold it for another 4-5 seconds as the board boots up. This will allow access to the files from your computer.

A normal boot up, without holding the touch pin, only allows access to the files from within the program code. The board manufacturer doesn’t let us access the files simultaneously from the computer and from within the program. If both happened to try and write to memory at the same time bad things could happen. Thus, we have to select one way or the other as needed.

Smart and nice.

Design one which works with a Jetibox.
Trump Derangement Syndrome. TDS. 
Avaiojet Derangement Syndrome. ADS.
Amazing how ignorance can get in the way of the learning process.
If you're Trolled, you know you're doing something right.  Alpha Mike Foxtrot. "No one has ever made a difference by being like everyone else."  Marcus Cordeiro, The "Mark of Excellence," you will not be forgotten. "No amount of evidence will ever persuade an idiot."- Mark Twain. I look at the Forum as a place to contribute and make friends, some view it as a Realm where they could be King.   Proverb 11.9  "With his mouth the Godless destroys his neighbor..."  "Perhaps the greatest challenge in modeling is to build a competitive control line stunter that looks like a real airplane." David McCellan, 1980.

Online CircuitFlyer

  • Trade Count: (0)
  • Commander
  • ****
  • Posts: 241
    • www.circuitflyer.com
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #4 on: July 10, 2021, 07:01:37 PM »
The idea was to create a low cost but full feature timer. Adding a separate programming box or card increases the costs. I have experimented with a bluetooth version, programmable via a smartphone, for about half the cost of a Jeti Box.
Paul Emmerson
Spinning electrons in circles in Mississauga, Ontario, Canada
Low Cost DIY Control Line Timer - www.circuitflyer.com

Offline RogerGreene

  • 21 supporter
  • Trade Count: (0)
  • Commander
  • *
  • Posts: 364
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #5 on: July 10, 2021, 07:05:45 PM »
Hi Paul,

What you suggested didn't work it's still write-protected. I tried going into properties and the file had an 'A', but that didn't work. The whole chip is write-protected. If I removed the jumper wire would that unwrite protection be removed?

I have another trinket MO and I copied the new Main.py to it without problems.

Roger
Fly Stunt <><
AMA 435R
USAF Veteran 1962-66 SAC
Life is 10% what happens to you and 90% of how you react to it. FAA #FA3RFLPAN7

Online CircuitFlyer

  • Trade Count: (0)
  • Commander
  • ****
  • Posts: 241
    • www.circuitflyer.com
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #6 on: July 11, 2021, 08:19:37 AM »
Well, that's weird.  I don't know why one would work fine and the other has issues.  Wiring changes won't make it accessible.  It needs to be done via software.  There is a way to connect to the board to troubleshoot and make the changes but, unfortunately, it would be a lengthy discussion if you are not familiar or experienced with programming microcontrollers. 

I suggest you just leave that one timer as it is.  It works just the same.  The update was just to fix some minor bugs.
Paul Emmerson
Spinning electrons in circles in Mississauga, Ontario, Canada
Low Cost DIY Control Line Timer - www.circuitflyer.com

Offline Avaiojet

  • 22 supporter
  • Trade Count: (0)
  • Admiral
  • *
  • Posts: 7966
  • Just here for the fun of it also.
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #7 on: July 11, 2021, 02:18:06 PM »
The idea was to create a low cost but full feature timer. Adding a separate programming box or card increases the costs. I have experimented with a bluetooth version, programmable via a smartphone, for about half the cost of a Jeti Box.

Many already have a Jetibox.

Best of both worlds?
Trump Derangement Syndrome. TDS. 
Avaiojet Derangement Syndrome. ADS.
Amazing how ignorance can get in the way of the learning process.
If you're Trolled, you know you're doing something right.  Alpha Mike Foxtrot. "No one has ever made a difference by being like everyone else."  Marcus Cordeiro, The "Mark of Excellence," you will not be forgotten. "No amount of evidence will ever persuade an idiot."- Mark Twain. I look at the Forum as a place to contribute and make friends, some view it as a Realm where they could be King.   Proverb 11.9  "With his mouth the Godless destroys his neighbor..."  "Perhaps the greatest challenge in modeling is to build a competitive control line stunter that looks like a real airplane." David McCellan, 1980.

Offline RogerGreene

  • 21 supporter
  • Trade Count: (0)
  • Commander
  • *
  • Posts: 364
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #8 on: July 11, 2021, 05:11:52 PM »
Okay, thanks Paul,

Well, that's weird.  I don't know why one would work fine and the other has issues.  Wiring changes won't make it accessible.  It needs to be done via software.  There is a way to connect to the board to troubleshoot and make the changes but, unfortunately, it would be a lengthy discussion if you are not familiar or experienced with programming microcontrollers. 

I suggest you just leave that one-timer as it is.  It works just the same.  The update was just to fix some minor bugs.

I am putting it on a profile called Mega Aetos. It was to have a Fox 35 but now it will be electric.

Thanks,

Roger

Fly Stunt <><
AMA 435R
USAF Veteran 1962-66 SAC
Life is 10% what happens to you and 90% of how you react to it. FAA #FA3RFLPAN7

Offline Paul Bray

  • Trade Count: (0)
  • New Pilot
  • *
  • Posts: 14
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #9 on: August 06, 2021, 01:47:43 PM »
Had a few nice flight yesterday with the new software loaded, to be honest I didn't notice any difference, worked great before and still does  ;D   ;D   ;D   ;D

The first flight was 30 seconds (new motor and battery test) and as I was enjoying it I got carried away and forgot to watch the LED resulting in the motor fading as I came around to inverted, quick decision and went for an inverted landing  :o   :o :o .

Anyway, quick vid of 2 flights, I then increased the motor run time to 1:30 and messed with the RPM for 4 flights, worked faultlessly.



Paul

Offline RogerGreene

  • 21 supporter
  • Trade Count: (0)
  • Commander
  • *
  • Posts: 364
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #10 on: August 14, 2021, 05:28:13 PM »
Hi Paul,

The second Trinket MO board that I bought and I did the software installation set-up wound up being write-protected and having the green light flash bright then it goes dim then out then bright then it goes dim etc. I put my finger on the pin and plugged in the USB cable and still the green flashing light etc.

If the programs are write-protected then I can't change the settings as per the 'Programing Procedure'.

I tried to edit the main.py line 125 to 36 and line 126 to 80 but the program would not save.

What can I do to make it work properly?

Roger
Fly Stunt <><
AMA 435R
USAF Veteran 1962-66 SAC
Life is 10% what happens to you and 90% of how you react to it. FAA #FA3RFLPAN7

Offline RogerGreene

  • 21 supporter
  • Trade Count: (0)
  • Commander
  • *
  • Posts: 364
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #11 on: August 18, 2021, 05:19:27 PM »
What makes the 'write-protect' turn on?
Fly Stunt <><
AMA 435R
USAF Veteran 1962-66 SAC
Life is 10% what happens to you and 90% of how you react to it. FAA #FA3RFLPAN7

Online CircuitFlyer

  • Trade Count: (0)
  • Commander
  • ****
  • Posts: 241
    • www.circuitflyer.com
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #12 on: August 19, 2021, 06:11:10 PM »
Roger,

Sorry I didn't reply sooner.  I was enjoying some holidays with the missus.

I may not be able to fix your specific issue as I have not experienced a Trinket that gets stuck in read-only mode.  Perhaps a file got corrupted.  At any rate, I can help you erase the memory and reformat the filesystem so that you can reset and start all over again with a fresh board.

What makes the 'write-protect' turn on?

On the USB drive you will see (2) program files - boot.py and main.py.  It's boot.py that loads first at power-up.  That is where the code 'remounts' the memory and allows access by USB (holding the touch pin)(your computer will have read/write access) or by the main.py program (not holding the touch pin)(your computer will see it as write protected).

What can I do to make it work properly?

It may be simplest to erase everything and start over from scratch.  This is not as hard as it sounds, it just involves some reading to learn about CircuitPython and how it works.  Don't worry, playing with some code shouldn't permanently damage your Trinket (wrong wiring on the other hand...).

First you will need to install a simple code editing program on your computer.  The program recommended by Adafruit is called Mu (don't ask me where they get these names from).  The Adafruit tutorial that explains the installation is https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor   Mu will allow you to open and edit the program code.  It also has a 'serial console' - a window where you can interact with the micro-controller.  You may have noticed some print statements in the program code.  The serial console is where the printed statements appear.  Error codes and statements will also show here.

For some information on connecting to the serial console read through https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console and https://learn.adafruit.com/welcome-to-circuitpython/interacting-with-the-serial-console to get the idea.  From the serial console you can interact directly with the microprocessor by entering the REPL mode.  For information on the REPL see https://learn.adafruit.com/welcome-to-circuitpython/the-repl

Using the REPL you can enter a few lines of code to erase the memory.  This will allow you to start fresh and reload CircuitPython and then the timer programs and libraries.  Once you are connected and in the REPL mode you will see the >>> cursor.  Type the following:

>>> import storage
>>> storage.erase_filesystem()

Hit enter and the CIRCUITPY drive will be erased and reformatted, and your board will restart. That's it!

Then follow my instructions using the downloaded files from my web page https://circuitflyer.com to reprogram the Trinket.  Don't forget to install CircuitPython first using the .UF2 file included in the download.  PM me if you have any trouble.

Paul
Paul Emmerson
Spinning electrons in circles in Mississauga, Ontario, Canada
Low Cost DIY Control Line Timer - www.circuitflyer.com

Offline RogerGreene

  • 21 supporter
  • Trade Count: (0)
  • Commander
  • *
  • Posts: 364
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #13 on: August 20, 2021, 08:32:50 PM »
Thanks, Paul,

I download all the files and went to work on fixing my three timers. Each with different running times AND they all are NOT WRITE PROTECTED  #^ H^^!! When in the Mu to make the bottom part (REPL) work on two timers I had to Ctrl +C so I could write those two commands. I now need to test them on the airplane when the rain stops.

Thanks again Paul you MADE MY DAY brighter.

Roger
Fly Stunt <><
AMA 435R
USAF Veteran 1962-66 SAC
Life is 10% what happens to you and 90% of how you react to it. FAA #FA3RFLPAN7

Offline RogerGreene

  • 21 supporter
  • Trade Count: (0)
  • Commander
  • *
  • Posts: 364
Re: UPDATE v1.2: Low Cost Open Source Timer
« Reply #14 on: August 21, 2021, 05:58:00 AM »
Also after I put the .uf2 file and the CIRCUITPY reappeared I checked each file's Properties for Archive and removed it. Then copied and pasted the lib folder, boot.py, and main.py files and checked each file on the Trinket MO for Archive Properties, and removed it. It seems that Micro$oft changes the files to Archive when going from the PC to Trinket MO.

Thanks again, Paul for your hard work.

Roger
Fly Stunt <><
AMA 435R
USAF Veteran 1962-66 SAC
Life is 10% what happens to you and 90% of how you react to it. FAA #FA3RFLPAN7


Advertise Here
Tags:
 


Advertise Here