Avatar for CoffeeCups

CoffeeCups

Member since Nov 2015 • Last active Apr 2021
  • 5 conversations
  • 19 comments

Bored LAMP Dev, having picked up reasonable JS skills now more interested in IOT than web dev, the people seem nicer too. I've been fiddling around with Arduinos, XBees etc for a while, enough to know I really am an electrical n00b.

Most recent activity

  • in Puck.js, Pixl.js and MDBT42
    Avatar for CoffeeCups

    The reason I piped up was one of the most useful Tasker recipes I found was "disable wifi if out of range of either home wifi or office wifi". Given the plethora of MITM (Man in the middle) attacks and access point spoofing, this stuck in my mind. I am guessing its the same with Tasker and Bluetooth. "When x happens send SMS" features quite a lot on Tasker, so I'd be surprised if you couldn't make a call.

  • in Puck.js, Pixl.js and MDBT42
    Avatar for CoffeeCups

    If your phone is rooted, and you have installed Tasker, (and understood its' complexities) then I would think what you want to achieve might be possible. Bluetooth Tasker Wiki search - might lead to some recipes, or maybe onto other clues.

  • in Projects
    Avatar for CoffeeCups

    Thanks for your considered thoughts Gordon.

    Yeah, finally worked out for myself that the HC-05s get through a lot of current, and the general lack of quality documentation (and discussion on StackOverflow) concerning the whole myriad of settings around their SNIFF settings left me flummoxed. Plus, classic BT is not really getting me the transmission distance I'd like.

    Anyhow, for anyone in the same boat I figured my options at that point included:

    • de-soldering the HC-05 from that awfully useful Serial1 "pad" on the Espruino and maybe wiring the power through a MOSFET too (I'm still in "Wow MOSFETs are cool" mode).

    • Ordering some HM-10s, but essentially that would still need the same ability to turn on/off

    • Using the beacon idea

    n00b101 moment : A major light bulb (well, LED I suppose) moment for me came when I finally understood DeepSleep. Just because the setSleepIndicator LED occasionally flickers does not mean the sum of all the kit welded to your Espruino is only using 0.04mah when asleep! Wire your multimeter in line with your battery early on, and assume nothing.

    As it happens I had some old Xbee units from a few years ago when I first started tinkering, so have spent the last few days in Xbee Javascript Hex data-packet hell, but now ready to put all this back together and test if I can power that up/down at will.

    Learning about Xbees might be a dead end, I realise, but it reminds me very much of s/w dev when I was learning Design Patterns. Reading about concepts is one thing, putting them into practice is entirely different - and is the only way (at least for myself) I can hammer the facts/issues into my brain so they stay learned.

    Xbees make the whole solution rather expensive, but if I have something that works it will be good, I can then start swapping components and ideas.

    Ultimately, BTLE and beacons is the way to for now. Anyone else thinking of going to Nordics BTLE dev day in Copenhagen?

  • in Projects
    Avatar for CoffeeCups

    Update on this. After many distractions, hw fails and quite a bit of effort my long life GPS logger is largely working as I wanted. Thanks for the help.

    I ended up using a MOSFET to switch power to the GPS, new knowledge and a new ability for me (and some more ugly soldering, sigh). I'm keeping it simple and logging to SD. I stuck with the HC-05 and this is working decently. The learning curve concerning the switching from USB to Serial1 console was steeper than I thought, but have now finally grokked that. I'm using Blueterm to query the unit at set times. (Blueterm+ does not have an output save option).

    I am doing some more tests now and I will post back how long I expect it to last on which sized battery, pseudo code :

    wake up every hour, on the hour
    if h hour is a match, turn on gps, log data,
    if h hour is a match, turn on Serial1 and listen for instructions for m minutes
    go back to deep sleep

    However, as I work though this project it has become clear to me (as I am horizon watching all the time) that instead of me having to physically be next to the device to download the captured data over BT at a very exact set time which may not be convenient, I could use a beacon to detect my phone is in range, and they wake up the device and switch Serial1 on for m minutes.

    Now I've ordered some Pucks like a good-un but I think they'd be overkill for this . I wondered if anyone could give me a pointer on whether there are any basic cheap beacons I could use for this, and if they've had any luck getting a beacon to send enough power to signal to Espruino to wake out of Deep Sleep? Is this even doable?

    This would make things far more convenient.

  • in General
    Avatar for CoffeeCups

    I see your point. Yes, the Daylight Saving (DST) would be a pain -- I even wonder if that would be worth the bother. As my device returns to base or gets in BT range I was going to reset the time as the argument in that func applies negative figures.

    I suppose as more devices are made wifi or LoRa capable then this need would diminish anyhow.

    Brilliant piece of kit all the same.

  • in General
    Avatar for CoffeeCups

    My IDE is set to transfer my computer time to my Espruino (Settings/Communications/Set Current Time), as long as I have a battery installed at the same time, I can unhook USB and continue with Serial1 on Bluetooth (HC-05).

    The problem is the time transferred is GMT without TZs or Summer Time adjustments.

    This leaves a 2 hour gap in my case. i.e. My computer tells me it is 15:00 hrs, but 13:00 hrs gets transferred to my Espruino. Now, maybe there is something in the guts of my computer I can change, but I doubt it.

    So I made this for now, posting it here in case anyone else is searching for a work-around.

    function addMins(mins) {
      newTime = getTime() + (mins * 60); 
      setTime(newTime);
    
      // if(dbg) {date = new Date(); console.log(date.toString());}
      
    }
    

    As I cannot believe that I am the only one who wants (almost) correct time sync with their devices I will ask : Any chance the IDE Set Current Time setting can have a GMT +/- hour diff option? OR maybe I have missed something?

  • in General
    Avatar for CoffeeCups

    I don't normally chime in on this forum because I am such an ee n00b too, but I remember being a s/w n00b and I too share your enthusiasm and excitement.

    If you don't have one, get a multimeter. Find out how to do a "continuity test". I'm from a s/w background and I think of this part of the tool as the equivalent of the basics of Unit Testing.

    Does pin x really connect to pin y of my sensor? Prove it. Buzzzz... yep.

    I admit I am quite interested how other s/w disciplines/patterns relate to ee, all I have so far is that and:

    Blinking LED = "Hello World"

    So no, not a terribly long list, not even sure how true this comparison rings, but its helping me until I find a better paradigm.

    I think buying a soldering iron is the equivalent of learning to touch-type for a programmer. It might be an expensive outlay (cash as apposed to time) but you will use it elsewhere, a skill for life. My wife is amazed at the things I can now "repair".

  • in General
    Avatar for CoffeeCups

    Espruino 1.4 flash v1.86 / 262144 I have the Serial over BT working fine, my question is when my board is deployed, how can I fine tune the system clock?

    I think I understand I can send the exact time when I send my code over to the board by clicking the correct IDE setting, and could add hours on to adjust for daylight saving or TZs etc.

    My concern is if the battery is changed/disconnected how would I go about sending the correct time and date to the system over BT?

    I read about Clock but I have doubts that this var eg clk is just that, a var I keep persisting, or does it indeed update the system clock?

    var Clock = require("clock").Clock;
     var clk=new Clock(2016,4,15,23,45,0,0);   // Initialise with specific date
    
Actions