Author Topic: mc-Things Video Suggestions??  (Read 184 times)

mc-T2

  • Administrator
  • Full Member
  • *****
  • Posts: 246
  • mc-Things! The opportunities are endless!
  • Location: Canada
    • View Profile
mc-Things Video Suggestions??
« on: August 03, 2016, 03:00:42 pm »
Hi Everyone!
As you know, there are so many things you can do with the mc-Things platform! As we say, the opportunities are endless!

We want to know if you have any of you have suggestions for our example videos! We have completed:

- Temperature network using IFTTT
- Door open and closed using the magnetic switch using MQTT and IFTTT
- Light sensor demo with the mc-Dev board and the mc-modules using

We have a couple of ideas up our sleeves and are putting together a couple other videos with some really cool projects (coming soon!) but we want to hear your suggestions as well. Please feel free to leave a reply here with your suggestion!
Need more mc-Modules, mc-Gateways or other mc-Things? Check out our product page: www.mcthings.com/products. mc-Development kits are available too!
Check out a live Dashboard using mcThings and Losant! Click here: https://goo.gl/ST43hB

Social Buttons


Conthings

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #1 on: August 05, 2016, 09:38:16 am »
Hi,

thanks for the great videos so far which helped me a lot.
I would be highly interested in a demo of the possibilities of the acceleration sensor.
Not only the "knock-knock"-feature sounds interesting, but especially the raw acceleration data are interesting for my use case.
This use case I want to realize is to measure the acceleration of a gate and to draw conclusions from this data if and how far the gate is opened.

Kind regards
Like Like x 1 View List

mc-T2

  • Administrator
  • Full Member
  • *****
  • Posts: 246
  • mc-Things! The opportunities are endless!
  • Location: Canada
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #2 on: August 05, 2016, 10:25:12 am »
@Conthings - Great suggestion! This is on a list for us to do already but I will bump it up!

Thanks again for the suggestion! Keep them coming!
Need more mc-Modules, mc-Gateways or other mc-Things? Check out our product page: www.mcthings.com/products. mc-Development kits are available too!
Check out a live Dashboard using mcThings and Losant! Click here: https://goo.gl/ST43hB

Conthings

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #3 on: August 06, 2016, 05:25:59 am »
Hey mc-T2,

following some ideas living in my head. The use cases are not limited to mcthings (or need an attached infrastructure/application) but the low-power-place-anywhere possibilities are a real enabler:

mcDash
+ attaching one or more buttons to create something like a self made amazon dash button (order new coffee beans / laundry detergent / dishwasher tab)

Coffee Machine
+ attaching a water level sensor to show in 1 cm steps how much water is in the tank
+ attaching a ultrasonic / infrared sensor to measure if there are enough coffee beans left

Freezer-Addon
sometimes I forget to but a bottle in the fridge. As a workaround I often place it in the freezer. There I forgot it more than one beeing remembered by that unusual sound coming from my freezer when the bottle exploded. To prevent that I thought about:
+ using the "Knock-knock" possiblity / or attaching a button to the mcmodule to start a simple countdown. When I open the freezer to place a bottle I just have to knock the mcmodule or to press the button and after 30 min I get a reminder on my cell to take the bottle out.

Kind regards,

dmm

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #4 on: October 19, 2016, 08:52:47 am »
Just a demo of how to use the accelerometer to read out the x, y, and z values as a device to track tilt of an object.

millennial

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #5 on: October 19, 2016, 12:52:46 pm »
My mcScript forked repository has an accelerometer library for everyone to use and an example of how to use it at the following link.

Note that this only works for the mc-Module 110.

https://github.com/Stephen-Meyerhofer/mcScript/tree/master/libraries/accelerometer/mma8652/0.1.0
Like Like x 1 View List

mc-T2

  • Administrator
  • Full Member
  • *****
  • Posts: 246
  • mc-Things! The opportunities are endless!
  • Location: Canada
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #6 on: October 19, 2016, 02:02:16 pm »
Thanks for the suggestions!
We are trying our best to get as many demo videos ready and pushed out for everyone to check out! Keep the suggestions coming!

And thanks Millennial for the accelerometer details. And for those working with the mc-Mod120 and wish to use the accelerometer (it is different than the accelerometer on the mc-Mod110), you can check out this thread where mc-Josh posted a beta library for the mc-Mod120 device.

http://mcthings.createaforum.com/support/module-120-accelerometer-communications/msg1187/#msg1187
Need more mc-Modules, mc-Gateways or other mc-Things? Check out our product page: www.mcthings.com/products. mc-Development kits are available too!
Check out a live Dashboard using mcThings and Losant! Click here: https://goo.gl/ST43hB

Nick_W

  • Full Member
  • ***
  • Posts: 212
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #7 on: October 19, 2016, 10:50:28 pm »
Millennial,

I just took a look at your library for the accelerometer in the 110 module - very nice, much better than my effort! I'll be using your library in future.

I've just posted a first pass at the accelerator library for the 120 module, it's pretty clunky compared to your 110 module version. I'll try to polish it up when I have time (back on the road next week). Feel free to take a look and suggest improvements.

Great job!
Like Like x 1 View List

millennial

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #8 on: October 20, 2016, 11:27:14 am »
Thanks, Nick_W. Your affirmation means a lot.

I drew upon the mc-Things alpha/beta and your code to make my mc-Module 110 version. Once I get the time, I'll be refactoring that code in a ST LIS2DH12 folder and publishing again.

Perhaps we can continue to pull from each other's ideas to make driver libraries available and easy to use. I particularly think version folders are important, so drivers can be enhanced without breaking existing application code.
Like Like x 1 View List

Nick_W

  • Full Member
  • ***
  • Posts: 212
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #9 on: October 20, 2016, 10:34:45 pm »
I think you are probably right about the version numbers.

You might want to turn on "issues" on your github site so we can comment there rather than here.

So far, it's working well, I fixed a couple of trivial items. The idea of using strings to feedback items is brilliant! I never would have thought of that. As you can probably tell I'm mostly a C programmer (not vb.net at all), so passing strings would not be a thing.

I am having a lot of trouble with sleep/wake mode though. Not with your library, more with the way the accelerator works. When you set sleep mode, when it wakes, you get 1 interrupt, not 2 as expected (ie strings "autosleep", "shock"). You have to read the interrupt, get "autosleep", then read the SMOD register (to clear the sleep/wake interrupt), then read the interrupt source register again, to get the actual interrupt, clear it, etc.

If you don't read SMOD, you get no more interrupts - autosleep is stuck there, if you don't read the int_source again, then clear it, you are again stuck.

This is not what I expected, I thought that you would get two interrupts, "autosleep", and "shock" (or whatever). So the for loop would handle it. Doesn't work.

Have you had any success with sleep mode? All the documentation glosses over the ISR routine part of things.

This is what the application notes say the ISR is supposed to be:

Code: [Select]
Interrupt void isr_KBI (void)
{
      //clear the interrupt flag
      CLEAR_KBI_INTERRUPT;
      //Determine the source of interrupt by reading the system interrupt register
      Int_SourceSystem = IIC_RegRead(0x0C);
      //Set up Case statement here to service all of the possible interrupts
      if ((Int_SourceSystem &=0x80)==0x80)
      {
            //Perform an Action since Auto-Sleep Flag has been set
            //Read the System Mode to clear the system interrupt
            Int_SysMod = IIC_RegRead(0x0B);
            if (Int_SysMod==0x02)
            {//sleep mode
            }
            else if (Int_SysMod==0x01)
            {//Wake Mode
            }
            else
            {//Error
            }
      }
}

Which really doesn't seem to be what happens.

Thanks.
« Last Edit: October 20, 2016, 10:46:09 pm by Nick_W »

millennial

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #10 on: October 21, 2016, 10:59:14 am »
I turned on "issues" for the mcScript fork. By default, those are not turned on for forks. Thanks for pointing this out.

Perhaps you can pull request my pull request and I can merge your trivial changes?

I haven't done much work with sleep mode either. My question relates to the output data rates (ODR). Will those registers simply be set to the same byte value, which just causes them to be interpreted differently? This may affect interrupt configuration, specifically when the GetMaxTimeAndTimeStep function is used internally. Not sure of the right answer here.

To theorize about your interrupt question, perhaps the application code should put a while loop around GetIntSource until nothing is returned. Maybe the driver library can return data for the IntSource's in some kind of 2D list and we put the while loop in GetIntSource. Another option would be to turn off the ELE latches.

I'll put this content into some GitHub issues and we can continue the work there.

Nick_W

  • Full Member
  • ***
  • Posts: 212
    • View Profile
Re: mc-Things Video Suggestions??
« Reply #11 on: October 21, 2016, 11:13:27 am »
I'll move over to github, but the while loop is exactly what I did (and it works). Testing for <> Nothing doesn't work (not sure why), so I'm testing for intType.Count > 0 which seems to do the trick.

Sleep mode just switches between sleep and wake ODR and oversampling modes, it doesn't change the registers. Seems to be working switching between 50Hz Low Power (sleep) and 400Hz Low Power Wake.

I'll post when I have all (most) of the bugs out of my code. I still get a random reboot when the Accelerator is in Standby and you try to read the int_source register (debug says I2C bus locked), probably a timing thing.