Dutch_Peter
Member since Jun 2019 • Last active Dec 2019Most recent activity
-
Vanilla javascript should work in Typescript as well, although it can help to prevent some bugs. I like the clean one on one IDE. If you work in Typescript, you'll have to build/compile it to javascript before uploading it to an Espruino device.
Maybe typescript uses a lot of polyfills, which would make the code bigger than vanilla javascript. Although Typescript can have its benefits. I'll doubt if it will be better for use in Espruino.
I'm working on a StencilJS PWA-application, which works in Typescript, just like many other front-end applications. I started to convert https://www.puck-js.com/puck.js to a typescript module, but it's a bit tricky.
For now, I have put it in index.html and 'imported' window.Puck to use the Bluetooth connectivity.
Regards, Peter
-
Hi,
I used the Data Collection example from:
https://www.espruino.com/Data+CollectionIf I save the example code with save(); I get this result:
Compressed 36000 bytes to 2643Which is saved to RAM if I'm correct. There is 64kB of RAM available, so this we will have plenty of room left.
There is 512kB Flash memory as well.
Does this mean I have 512kB of Flash memory available for data collection?
Thanks, Regards, Peter
-
Hi Gordon,
Thanks for your feedback. Measuring voltage is a very good idea. If it's low: go back to sleep/idle and safe energy for a later moment. Using a solar battery charger is a good idea, maybe those solar powered garden light can be useful as well, just to see what circuit they have.
Regards, Peter
-
- 5 comments
- 2,479 views
-
Hi Gordon,
Thanks for your reply. I want to use wifi mainly for sniffing every 2 hours. So some writing to flash would be needed for a short amount of time.
Maybe a lightsensor could help to get an indication about the ambient light and thus the solar cell / supercapacitor.
But when it sees a trusted network, like office or home it should calculate if there is/was enough light and if a trusted network is within reach to upload the log of wifi sniffing. The device will be outside, so logging light every 2 hours will also give an indication if it is morning or evening. In the evening the supercapacitor should have enough power to run for 5 seconds or something like that.
If that won't work, the device will be at the office or at home, at a trusted location, so we can pick it up, power it and upload the log as well.
What type of capacitor should work in this case? How easy can the circuit be?
Regards, Peter
-
As many on this forum and in general at IoT, I'm looking for a way to extend the battery life, or... to not use a battery at all.
I do have a technical background, but not in electronics. I don't have a lot of requirements about when or if the Espruino should work, because I was thinking about this:
- Trigger the Espruino wifi once in 2 hours.
- Use ambient light harvesting, a lot about it is written in here: https://www.digikey.com/en/articles/techzone/2017/jun/a-simple-approach-for-harvesting-energy-from-indoor-lighting in combination with a supercapacitor
- If there is no energy left, that's a pitty, but not really a problem for me. I don't know if it's a problem for the Espruino? Or can it be a problem if the Espruino wil crash / or get an power outage during code execution?
- If there is light enough / energy enough in the capacitor, then trigger again once in two hours.
Regards, Peter
- Trigger the Espruino wifi once in 2 hours.
Dutch, male, interested and happy about anything with javascript (progressive web apps, nodejs, stenciljs, brainjs, firebase, cloud functions, chrome extensions, and so on).