### Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

### Messages - Junkboy

Pages: [1]
1
##### mc-Innovations / Translate acceleration in G's to textual states.
« on: July 09, 2018, 03:10:42 pm »
Hello community of McThings, I am developing a project, in which I am using a module Mc120, which currently transmits via MQTT the angles of inclination and the acceleration of all its axes, all this information is sent every 3 seconds, since it is Very fast, a battery that in "theory" should last up to 5 years lasts no more than 2 weeks.

What is currently done is to receive the acceleration and tilt of the device in an MQTT server, the information is analyzed to translate the states to a person for example "Walking" or "Running" etc.

What I want to do to save battery is the following:

I think to use the function:
accel.ConfigureMotionInterrupt (1.15, 20.0)

This would cause an interruption when there is an acceleration equal to or greater than 1.15G for more than 2 ms, this is just an example in practice those parameters would change.

The idea would be to set the parameters so that when there is some acceleration the device wakes up and knows that there is movement, then it would have to verify in which case it is.

In my personal experience I know a lot more about the C ++ language so I can imagine it in this way in C ++:

if (accel> = 1.15)
{
state = ON;
}

if (accel> = 1.15 && accel <= 1.
{
printf ("Walking"),
}
if (accel> = 1.81 && accel <= 2.2)
{
printf ("Runing"),
}
if (accel <= 1.15)
{
printf ("Stopped"),
}

With these conditions I seek to make instead of every 3 seconds send me the acceleration etc, better the device stays off until there is some acceleration and send me the message that is what you are doing, in the case of "Stopped" is only to put it because in reality if there is no acceleration greater than 1.15 will not turn on, that's the idea and in fact I also have to do some condition or something so that as long as it is lower than 1.15 send the message "Stopped" but. I do not want them to repeat either, that is if the current state is "Stopped" that sends it only once, if it starts to walk then it sends "Walking" but if it kept walking 15 minutes, do not send me that message again until it change of state

I hope to be explaining, the truth is a bit complicated programming in McStudio for me, but I would like to know if someone can help me to translate this to the language used in McStudio because for example I do not know how to put a conditional with intervals, in the case of "if (accel > = 1.15 && accel <= 1." I do not know how to do it in McStudio, nor am I sure how to make the data not repeat.

I would really appreciate very much if someone could support me a little with this.

Beforehand thank you very much.

2
##### mc-Things General Discussion / Re: Help with the accelerometer (mcMod120)
« on: July 05, 2018, 04:38:06 pm »
Thank you Nick_W, that help me a lot, I will send you a message, check it out please !

3
##### mc-Things General Discussion / How can I put an mcMod120 in sleep mode for 10 minutes and then run the program?
« on: June 25, 2018, 05:36:59 pm »
Basically what I want is to put the mcMod120 to send data 60 minutes, then put it in sleep mode for 20 minutes, then again 60 minutes sending and 20 minutes in sleep mode, and this is repeated infinitely.

I currently use this line to send data every 5 seconds:
Shared Event Publish() RaiseEvent Every 5 Seconds

What I'm going to do, is put in place of 5 seconds, 60 minutes, and I'm looking for a function to put:

Sleep (20 min)

And let this start again ..

4
##### mc-Things General Discussion / Re: Help with the accelerometer (mcMod120)
« on: June 09, 2018, 12:07:35 pm »
In addition to the previous question, I would like to know if there is any instruction that gives me the acceleration in each axis, because the example that you shared with me shows the following:

'set accelerometer to cause interrupt if accelation is > 1.4Gs for longer than 5ms (any axis)
dev.ConfigureShockInterrupt(1.4F, 5)

but .. it is in any axis, I am interested in obtaining the acceleration in each of the axes.

5
##### mc-Things General Discussion / Re: Help with the accelerometer (mcMod120)
« on: May 30, 2018, 08:18:33 pm »
I am trying to do my best to understand how the code that you send me as an example works, but is there a way to always be sending the current orientation of the device? I want to know at all times or as soon as possible the location, let me put you in context, for example, at the start I have: X = 0 Y = 0 Z = 0 in that case the device would be on the floor with all axes at "0" but let's say I start walking with the device at my leg, in that case let's say that we would have X = 12 Y = 8 Z = 15 that data I want to be taking for example every second or every 500 ms to keep a continuous tracking of the information, right now idk how to send that info by MQTT but.. I use an example that I found at internet that send the temp and batteryVoltaje to Losant and I'm using Losant until I learn how to send that data to my own server.

6
##### FAQ's / Re: Registering New Devices - Help, I'm new in Mcthings
« on: May 29, 2018, 06:51:44 pm »
ohh okay so right now I can't use mcCloud, right?

7
##### mc-Things General Discussion / Re: Help with the accelerometer (mcMod120)
« on: May 29, 2018, 06:49:20 pm »

8
##### mc-Module / Re: Accelerometer count step o interruptions
« on: May 28, 2018, 10:54:13 pm »
Hey dude I hope you see this, I'm new with mcthings, I would like to know where you learned to get information about the accelerometer? I am developing something similar, I also need to know when a person is walking, therefore I need to know the movement in any axis and send it to Losant. Do you think you could help me? Until now I only learned to get information about the temperature and voltage of the battery.

9
##### mc-Platform General / Help with the accelerometer (mcMod120)
« on: May 28, 2018, 10:50:21 pm »
Hello, I just started using mcthings, I just bought my kit and the only example I could find that has served me is to take the temperature and voltage of the battery and send the data to Losant.

Now .. I am developing a project in which I need to obtain the accelerometer data, I need to know the inclination in all the axes, all this info I need to send it using MQTT, the continue using Losant could be a good option.

Therefore I would like someone to help me in my search for information since I really have 2 days looking for examples and I can not find anything about the accelerometer, I would even like to know how to use the reef sensor.

I would be infinitely grateful for the help because I am stopped because I do not know how to obtain this information from the sensor.

Beforehand thank you very much.

10
##### mc-Things General Discussion / Help with the accelerometer (mcMod120)
« on: May 28, 2018, 10:50:08 pm »
Hello, I just started using mcthings, I just bought my kit and the only example I could find that has served me is to take the temperature and voltage of the battery and send the data to Losant.

Now .. I am developing a project in which I need to obtain the accelerometer data, I need to know the inclination in all the axes, all this info I need to send it using MQTT, continue using Losant could be a good option.

Therefore I would like someone to help me in my search for information since I really have more than 2 days looking for examples and I can not find anything about the accelerometer, I would even like to know how to use the reef sensor.

I would be infinitely grateful for the help because I am stopped because I do not know how to obtain this information from the sensor.

Beforehand thank you very much.

11
##### FAQ's / Registering New Devices - Help, I'm new in Mcthings
« on: May 27, 2018, 12:50:37 pm »
I'm watching the "Getting started with mcThings" but in the second video the guy type the name of the new device then type the mcUID that I find out that number is in a label in the device but.. when he has to type the "mcREGKEY" he don't say where can I find that "key" so.. idk what number I have to type.

I hope you could understand my problem, and I'm sorry about my english it's not perfect but I thing that you could got my idea.
Thank you.

Pages: [1]