Avatar for patmolloy

patmolloy

Member since May 2014 • Last active Dec 2016
  • 2 conversations
  • 8 comments

Most recent activity

    • 6 comments
    • 3,220 views
  • Avatar for patmolloy

    Sigh. You are right of course. I had tried (and failed) to use an oldish Android phone to connect. And gave up. Then got it working on a little Android tablet .. but exhibiting the behaviour above. And actually the same behaviour in various BT tools on my iPhone.

    It turns out that the original, failed, old Android phone was still up to something. Presumably connecting.

    This is why the power-cycle/timing thing worked some of the time .. I was beating it (old phone) to connecting. Switching off old phone has cured problem !

    Sorry to waste everyones time !

    Pat

  • Avatar for patmolloy

    Hmm. Thanks!

    I think I have a different situation .. Once Chrome cannot see the Puck, that's it .. I have to pull the battery and try over again. Once I do get paired, and connected it's fine. But if I then disconnect (in the ide) and try to pair again, I get the "https://www.espruino.com wants to pair with:" and "No Bluetooth devices found. Re-scan."

    Hitting Re-scan will not find anything, unless I power-cycle the Puck, in which case the device appears almost immediately. If I hit "pair" quickly, it pairs and usually connects, but sometimes stalls on connect, in which case power-cycling usually sorts it ..

    Odd.

  • Avatar for patmolloy

    Hi, I am having intermittent success getting mine to play nice at the moment.

    Booting with switch pressed - passes self test.
    Booting no switch - brief red flash.

    Using LightBlue Explorer .. I see the Puck advertise itself as Puck.js 5f19 but only briefly (few seconds) before it disappears. Consistent behaviour on reboot.

    WebBluetooth enabled on Chrome fine. I generally get "No Bluetooth devices found, Re-scan". If I re-scan and I am quick enough, I can then see the device, pair with it and connect successfully - and it works just fine. But the timing is pretty finnicky. I can miss the pair, or get the pair and miss the connect.

    Is this expected behaviour ?

    Thanks

    Pat

    (p.s. fab device, as usual !)

  • in General
    Avatar for patmolloy

    Ah ! Nice to know what was going on, thanks.

  • in General
    Avatar for patmolloy

    And of course it just works now :)

    Thanks ever so .. blindingly obvious now that you point it out, but was definitely working in that form, for some reason, on a previous version.

    Thanks a million.

  • in General
    Avatar for patmolloy

    I have been running this little program for months just to display temperature ..

    var lcd = require("HD44780").connectI2C(I2C1);
    var ow = new OneWire(B13);
    var temp = require("DS18B20").connect(ow);
    	
    function onInit() {
    	I2C1.setup({scl:B6, sda:B7});
    	
    		
    	setInterval(showData, 5000);
    }
    
    
    function showData() {
     lcd.clear();
     lcd.setCursor(0,0);
     lcd.print("Current temperature:");
      
     // Get the temperature
     var t = temp.getTemp();
      
     // Round it to the nearest 0.1
     t = Math.round(t*10)/10;
      
     lcd.setCursor(0,1);
     lcd.print("Temp = " + t + " C");
    }
    
    
    onInit();
    
    

    I updated to 1.69 just now (actually not sure what the previous version was) and see this .. which means little to me :( Can anyone here tell me what might have broken and how to fix ? I've swapped the LCD for another, but the same problem ...

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v69 Copyright 2014 G.Williams
    >echo(0);
    Uncaught Error: I2C device not responding
     at line 2 col 7
    4,e,e])}
           ^
    in function "a" called from line 1 col 8
    {a(51,1);a(50,1);a(40,1);a(12,1);a(6,1);a(1,1);return{write:...
            ^
    in function "f" called from line 2 col 9
    4,e,e])})}
             ^
    in function "connectI2C" called from line 1 col 45
    var lcd = require("HD44780").connectI2C(I2C1);
                                                 ^
    =undefined
    ERROR: Error processing interval - removing it.
    Execution Interrupted during event processing.
    Uncaught Error: Field or method does not already exist, and can't create it on undefined
     at line 2 col 5
     lcd.clear();
         ^
    in function called from system
    > 
    
  • in General
    Avatar for patmolloy

    Ditto. All working for me and definitely more reliable than cc3k IMO. You do have to use the special WZZnet build, though. Could that be the problem ?

  • in General
    Avatar for patmolloy

    Well, something magical has happen on 1.63 Wiznet .. this code now works perfectly ! I can switch the onboard leds on and off from a little web page !

    E.enableWatchdog(10);
    
    var eth = require("WIZnet").connect();
    eth.setIP({ ip : "192.168.254.248" });
    eth.setIP({ dns : "208.67.222.222" });
    eth.setIP({ gateway: "192.168.254.100" });
    
    
    function onPageRequest(req, res) {
      res.writeHead(200, {'Content-Type': 'text/html'});
      res.write('<html><body>');
      res.write('<p>Button is '+(BTN.read()?'on':'off')+'</p>');
      res.write('<p>Turn LED1 <a href="/on1">on</a> or <a href="/off1">off</a></p>');
      res.write('<p>Turn LED2 <a href="/on2">on</a> or <a href="/off2">off</a></p>');
      res.write('<p>Turn LED3 <a href="/on3">on</a> or <a href="/off3">off</a></p>');
      res.end('</body></html>');
      if (req.url=="/on1") digitalWrite(LED1, 1);
      if (req.url=="/off1") digitalWrite(LED1, 0);
      if (req.url=="/on2") digitalWrite(LED2, 1);
      if (req.url=="/off2") digitalWrite(LED2, 0);
      if (req.url=="/on3") digitalWrite(LED3, 1);
      if (req.url=="/off3") digitalWrite(LED3, 0);
    }
    
    require("http").createServer(onPageRequest).listen(80);
    
    
    
Actions