Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Derek Wheelden
    @frxnz
    @dtex Testing the PWM driver now. Something doesn't seem quite right
    I got servo.sweep() to work once, but it the steps were kind of erratic. And now I can't get the servo to move
    Also, guessing you'll want to add this line:
    Imp.prototype.sendI2CConfig = Imp.prototype.i2cConfig;
    Derek Wheelden
    @frxnz
    It started working again, not sure what happened there. Here's a video of servo.sweep() weirdness https://www.dropbox.com/s/bvbkm8mwfpr085a/servo.mov?dl=0
    I noticed there were timing issues even with led.blink(), so may not be an I2C issue?
    All of the other servo methods seem to work fine
    Donovan Buck
    @dtex
    That all makes sense and works as expected. Keep in mind that any commands sent from Johnny-Five are relayed through a cloud service and all the timing for both sweep and blink are handled in Johnny-Five. A new command is sent for each change of state and each command has to go through the cloud service. In sweep, we literally set each and every position throughout the sweep from Johnny-Five. Thank you for checking this out.
    I just watched the video. Honestly, I’m really impressed that sweep worked as well as it did.
    Donovan Buck
    @dtex
    Maybe one day we will have direct LAN communication with the Imp (like Voodspark) and be able to do more “real-time” things. Until then this platform is better suited for things where a second or so of latency won’t matter. For those things the Imp is completely kick ass.
    Derek Wheelden
    @frxnz
    Yea I realized it was going over wifi after I stepped away. D'oh!
    Donovan Buck
    @dtex

    @rwaldron There are two things I would like to add to imp-io but they are not things found/done in Firmata. I think they are important given the nature of how the Imp works.

    1. Add a reporting frequency parameter to the io opts with a default of one whole second. This allows us to set the interval that is used for Reporting.update(). A typical IoT project could have a value measured in minutes instead of milliseconds. Currently most reports back to the agent are ignored so they are wasting bandwidth.
    2. Add a command to remove elements from the Reporting.pins array. I would like to tell the Imp to stop reporting when I get the result of an i2cReadOnce call.

    Both of this things are easily done, but for the second I need to add a command. What is the authoritative source for this list and can I add new ones?

    const PIN_MODE = 0xF4;
    const ANALOG_WRITE = 0xE0;
    const SERVO_WRITE = 0xE1;
    const DIGITAL_WRITE = 0x90;
    const REPORT_ANALOG = 0xC0;
    const REPORT_DIGITAL = 0xD0;
    const I2C_REQUEST = 0x76;
    const I2C_REPLY = 0x77;
    const I2C_CONFIG = 0x78;
    const SYSTEM_RESET = 0xFF;
    Rick Waldron
    @rwaldron
    SAMPLING_INTERVAL = 0x7A
    Donovan Buck
    @dtex
    Perfect, I’ll use that for item 1
    Rick Waldron
    @rwaldron
    i2cReadOnce and i2cRead have “sub commands” that are built-in
    one sec
    for i2cReadOnce:
    The naming has always been backwards here
    When I added i2cRead to Firmata.js, I wanted that to match analogRead, digitalRead
    so if you adjust your i2c command params with the read “mode” after the address and bfore the register, you’ll be all set
    Donovan Buck
    @dtex
    Cool, I’ll fix that. I totally had it backwards in my head.
    Rick Waldron
    @rwaldron
    On the standard firmata side, there is a mask whose value is 24
    mode = READ_MODE & MASK
    READ_MODE is the value you sent from imp-io
    MASK = 24
    Rick Waldron
    @rwaldron
    For the reporting part, you could consolidate digital reading into a single value and shift the bits in imp-io to derive the pin values
    there are only 6 pins, so you’d have two unused bits
    (because you’d use a single 8 bit value)
    This is what spark-io does
    fortunately, you wont also have to split that value into two 7-bit values haha
    Analog reads cannot follow this pattern, since the value is 0-1023, not 0-1
    same with i2c
    but it still reduces all digital reading to one report
    @dtex looks like we’re already using sampling interval on the io-plugin side: https://github.com/rwaldron/imp-io/blob/master/lib/imp.js#L377-L381
    just coordinate that with whatever you’ve got on the tyrion side?
    ok, i need to walk dogs now
    back in a few
    Donovan Buck
    @dtex
    Okay, I’ve got the digital read and sampling interval work done and I’m about to do the sub mode work for I2C but I still think I have a special case here. After sending the result of a single non-continuous read to the agent, I need to keep that value coming until I know for sure that imp-io has received it. In other words, I may need it to live for more than one interval depending on timing, luck, connectivity, etc. It seems to me I have to be able to send some kind of ack to let the device know it can stop reporting.
    Donovan Buck
    @dtex
    Nevermind, I have a solution.
    Donovan Buck
    @dtex
    @rwaldron @soundanalogous Thank you guys for the tip on that button debounce thing. It totally solved what I thought was a problem with imp-io/Tyrion.
    Jesse cogollo
    @jessecogollo
    Hi everyone, I have a question.
    Anyone tried to use the proximity component HCSR04 with a electric imp?
    I am following this link https://johnny-five.readthedocs.io/en/stable/proximity-hcsr04/
    But I get the next error:
    TypeError: this.io.pingRead is not a function
    'use strict';
    
    const five = require("johnny-five");
    const Imp = require("imp-io");
    
    const board = new five.Board({
      io: new Imp({
        agent:  process.env.IMP_AGENT_ID
      })
    });
    
    board.on("ready", function() {
      let proximity = new five.Proximity({
        controller: "HCSR04",
        pin: 7
      });
    
      proximity.on("data", function() {
        console.log("Proximity: ");
        console.log("  cm  : ", this.cm);
        console.log("  in  : ", this.in);
        console.log("-----------------");
      });
    
      proximity.on("change", function() {
        console.log("The obstruction has moved.");
      });
    });
    Donovan Buck
    @dtex
    PingRead has not been implemented in Imp-io
    Jesse cogollo
    @jessecogollo
    😱
    J.Coleman
    @AlphaNerd

    Hey room... newb here. New to gitter and imp-io. Looking for some help with my Imp-io setup. My node app is crashing if my imp is not on and connectable. Is there something I'm missing here? Even when I use a try{} catch(e){} it still crashed my server.

    Would like to be able to have it simply return an error I can log out.

    Anyone know what to do here?

    This message was deleted
    try{
        var board = new five.Board({
          io: new Imp({
            agent: "############"
          })
        });
        board.on("ready", function() {
          var led = new five.Led(1);
    
          led.blink(1000);
        });
    }
    
    catch(e){
        console.log("Can't connect to Imp")
    }
    Donovan Buck
    @dtex
    Are you getting an error message when it crashes?