Speed Camera Project

paulfer

Member
IMG-20240706-WA0005.jpeg

Herewith the beta tested version of my latest project.

I used a Teensy4.1(T41) attached to my custom made board, to capture the overspeed of vehicles and then snap a picture of them.

The T41:
  • reads the vehicle speed,
  • takes a snapshot via an instruction to a HIKVISION camera,
  • Saves the image to the thumb drive
  • Uploads the image with all its data to the server via LTE and the ethernet port,
  • Emails the end user
  • Writes/overlays relevant data to the image, and
  • this all in less than 3 seconds!
Things that impressed me about the T41:

  • All libraries worked first time
  • All hardware, ETH, USB, and 8MB EXTMEM worked flawlessly from the getgo.
  • The EXTMEM allows me to effortlessly capture full resolution images.
Things I still have to do:
  • Figure out/study up how to lock the TEENSY without bricking it.
Here is a sample of the final images:

#C1-2024-06-07-13-31-05-40s.jpg
 
Nice project !!

Your next step "to lock the TEENSY without bricking it" is very easy !! From the Arduino 1.8.19 IDE, you simply select "Tools > Teensy 4 Security". From the popup dialog, click the "Generate Key" button. This step will result in creating your private key (the dialog shows where it will be stored). Pay particular attention to the warning that you MUST store your key securely (also, make sure that you have a backup somewhere else, also stored securely . . . if you lose this key, you completely lose the ability to create the locked hex file required (re)program any Teensies locked with this key). This key generation is a one-time necessity (although you could potentially manage multiple private keys, doing so requires very careful management to make sure that you always use the right key from your collection that matches the key used to lock a given Teensy in order to create the new locked hex file).

Once you have your private key, you can then click the "Fuse Write Sketch" button to open a sketch that allows you to setup/prepare a particular Teensy to be locked. Following that, clicking the "Lock Security Sketch" opens a final sketch that allows you to actually set the Teensy as locked. This is a non-reversible step: once a Teensy is locked, it can only be reprogrammed using an eHex file that has been created using your matching private key. The required eHex file is automatically generated by the build process if/when a private key is found in the right place . . . you don't have to do anything special and/or different when building the sketch that you're protecting. Your private key is only required to create the eHex file, it is not required to actually (re)program the locked Teensy.

Once you have completed these preparation steps for using a lockable Teensy, either the 1.8.x Arduino IDE or the newer 2.x.x Arduino IDE can be used to create your sketches and/or to update/load your locked Teensies. There are other 3rd-party development tools. I don't use any of these, so you'll have to look for specifics yourself if you are interested in using anything other than the Arduino IDE tools.

Despite what you might read, there is absolutely *NO* chance of bricking a lockable Teensy, if all of the steps are properly performed. Of course, you will lose the ability to build the proper eHex file needed to (re)program any Teensies locked with a particular private key if you lose that key. In this case, the Teensy is not bricked, but there is absolutely no way for that particular Teensy to be (re)programmed without using the same key that it was initially locked with to build the eHex file. That's part of the "security" of the lockable Teensy, and that's a GOOD thing !!

NOTE: I personally found it best to cycle power on the Teensy after each step of the initial locking process (as described/provided in the "Teensy 4 Security" dialog). I have been using lockable (and locked) Teensies for quite some time, and I have never had any problem after locking them. I predict that your experience with locked Teensies will be likewise just as successful.

You can find more details on the additional capabilities and protections provided by the lockable Teensy at the following link: https://www.pjrc.com/store/teensy41.html#codesecurity.

Good luck & have fun !!

Mark J Culross
KD5RXT
 
Nice project !!

Your next step "to lock the TEENSY without bricking it" is very easy !! From the Arduino 1.8.19 IDE, you simply select "Tools > Teensy 4 Security". From the popup dialog, click the "Generate Key" button. This step will result in creating your private key (the dialog shows where it will be stored). Pay particular attention to the warning that you MUST store your key securely (also, make sure that you have a backup somewhere else, also stored securely . . . if you lose this key, you completely lose the ability to create the locked hex file required (re)program any Teensies locked with this key). This key generation is a one-time necessity (although you could potentially manage multiple private keys, doing so requires very careful management to make sure that you always use the right key from your collection that matches the key used to lock a given Teensy in order to create the new locked hex file).

Once you have your private key, you can then click the "Fuse Write Sketch" button to open a sketch that allows you to setup/prepare a particular Teensy to be locked. Following that, clicking the "Lock Security Sketch" opens a final sketch that allows you to actually set the Teensy as locked. This is a non-reversible step: once a Teensy is locked, it can only be reprogrammed using an eHex file that has been created using your matching private key. The required eHex file is automatically generated by the build process if/when a private key is found in the right place . . . you don't have to do anything special and/or different when building the sketch that you're protecting. Your private key is only required to create the eHex file, it is not required to actually (re)program the locked Teensy.

Once you have completed these preparation steps for using a lockable Teensy, either the 1.8.x Arduino IDE or the newer 2.x.x Arduino IDE can be used to create your sketches and/or to update/load your locked Teensies. There are other 3rd-party development tools. I don't use any of these, so you'll have to look for specifics yourself if you are interested in using anything other than the Arduino IDE tools.

Despite what you might read, there is absolutely *NO* chance of bricking a lockable Teensy, if all of the steps are properly performed. Of course, you will lose the ability to build the proper eHex file needed to (re)program any Teensies locked with a particular private key if you lose that key. In this case, the Teensy is not bricked, but there is absolutely no way for that particular Teensy to be (re)programmed without using the same key that it was initially locked with to build the eHex file. That's part of the "security" of the lockable Teensy, and that's a GOOD thing !!

NOTE: I personally found it best to cycle power on the Teensy after each step of the initial locking process (as described/provided in the "Teensy 4 Security" dialog). I have been using lockable (and locked) Teensies for quite some time, and I have never had any problem after locking them. I predict that your experience with locked Teensies will be likewise just as successful.

You can find more details on the additional capabilities and protections provided by the lockable Teensy at the following link: https://www.pjrc.com/store/teensy41.html#codesecurity.

Good luck & have fun !!

Mark J Culross
KD5RXT
FABULOUS thanks a mil! I'll do exactly this ta!
 
Nice project !!

Your next step "to lock the TEENSY without bricking it" is very easy !! From the Arduino 1.8.19 IDE, you simply select "Tools > Teensy 4 Security". From the popup dialog, click the "Generate Key" button. This step will result in creating your private key (the dialog shows where it will be stored). Pay particular attention to the warning that you MUST store your key securely (also, make sure that you have a backup somewhere else, also stored securely . . . if you lose this key, you completely lose the ability to create the locked hex file required (re)program any Teensies locked with this key). This key generation is a one-time necessity (although you could potentially manage multiple private keys, doing so requires very careful management to make sure that you always use the right key from your collection that matches the key used to lock a given Teensy in order to create the new locked hex file).

Once you have your private key, you can then click the "Fuse Write Sketch" button to open a sketch that allows you to setup/prepare a particular Teensy to be locked. Following that, clicking the "Lock Security Sketch" opens a final sketch that allows you to actually set the Teensy as locked. This is a non-reversible step: once a Teensy is locked, it can only be reprogrammed using an eHex file that has been created using your matching private key. The required eHex file is automatically generated by the build process if/when a private key is found in the right place . . . you don't have to do anything special and/or different when building the sketch that you're protecting. Your private key is only required to create the eHex file, it is not required to actually (re)program the locked Teensy.

Once you have completed these preparation steps for using a lockable Teensy, either the 1.8.x Arduino IDE or the newer 2.x.x Arduino IDE can be used to create your sketches and/or to update/load your locked Teensies. There are other 3rd-party development tools. I don't use any of these, so you'll have to look for specifics yourself if you are interested in using anything other than the Arduino IDE tools.

Despite what you might read, there is absolutely *NO* chance of bricking a lockable Teensy, if all of the steps are properly performed. Of course, you will lose the ability to build the proper eHex file needed to (re)program any Teensies locked with a particular private key if you lose that key. In this case, the Teensy is not bricked, but there is absolutely no way for that particular Teensy to be (re)programmed without using the same key that it was initially locked with to build the eHex file. That's part of the "security" of the lockable Teensy, and that's a GOOD thing !!

NOTE: I personally found it best to cycle power on the Teensy after each step of the initial locking process (as described/provided in the "Teensy 4 Security" dialog). I have been using lockable (and locked) Teensies for quite some time, and I have never had any problem after locking them. I predict that your experience with locked Teensies will be likewise just as successful.

You can find more details on the additional capabilities and protections provided by the lockable Teensy at the following link: https://www.pjrc.com/store/teensy41.html#codesecurity.

Good luck & have fun !!

Mark J Culross
KD5RXT
Just to report back, I successfully locked my lockable Teensy. Thanks again!
 
Locking works well. Two T_4.1 I see on my desk are both lockable and Locked.

One is a Pre-Production Beta and the other does have a production LOCK stamp on.

Off to the side but used in the past days is a Beta PreProduction locked T_4.0 - these are my 'Daily Drivers'
Also active now is a Locked Beta SFUN Teensy MicroMod board.

All use the same original key.PEM - since 'Beta' years ago : 9/7/2021
 
Paulfer,
Unless you are the police, do you know if you are allowed to do such things ?
It seems you analyze plate numbers and link them to e-mail addresses.
In some countries, they are some laws about privacy, personnal data protection, and so on.
 
Back
Top