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 - mc-T2

Pages: 1 2 [3] 4 5 ... 17
MQTT / Re: Trouble sending/receiving data to CloudMQTT
« on: October 03, 2017, 11:24:19 am »
Hi Babramovitch,

Yes, that video was put together using an older version of mcStudio (when the gateway configuration did not include all the features as it does today).

Client ID - You have the same client ID in your gateway settings as you do in your app settings - this could be the problem. They need to be unique (not the same) otherwise they can't 'talk' to eachother. Try changing the client ID either in the gateway config or on the app to something different and try it out.

As for WIFI, You can connect the gateway using WPS or, you can enter the SSID and Password into the gateway configuration (you need to connect the gateway to either WPS or ethernet first to be able enter those details). If you are already connected to WIFI (most likely through WPS), then you don't need to enter the SSID and password info - the gateway will remember the WPS details and continue to connect to that network until you change it

Everything else appears to be good - let us know if changing the client ID allows this to work for you

mc-Demo205 / Re: how I can to write and read data in the flash memory?
« on: August 16, 2017, 09:44:52 am »

We will be documenting the Log functions in the next release - it will be updated within the documentation.

Glad that you have the temperature information going into Losant, this means that you have that side of things setup properly. And also good that you were able to update the device and mcStudio to the latest version.

I believe that you are using the GPS function and Log function:

if a GPS acquisition is ongoing, the log read has to wait for that to finish. Currently (this is changing when we do the warm start) both the logging and gps share a single SPI bus so they can't both happen at the same time.... This might lead to some less that elegant behaviours when debugging... for example if it takes too long for the GPS to finish mcStudio might stop and think the device is not responding...
The system will recover itself. So basically the execution of that line will be suspended until the gps acquisition is done.

Try loading the code directly into the device and see how everything works. It sounds like the issue you are having resides strictly within the debugging of the code and could be affected by what we mention above

Hope that helps,

mc-Demo205 / Re: how I can to write and read data in the flash memory?
« on: August 04, 2017, 09:39:57 am »

1) Have you setup Losant properly? By that I mean, have you setup the device properly within Losant and entered the correct device ID into your code for the device?
2) Have you configured your gateway properly to direct the information to your account within Losant?
3) You do need to ensure that you are in range of the gateway so that you can send the information out
4) When you first power the device, you need to ensure that it is in range of the mcGateway for a period of time so that it can capture the current time from the gateway. If you don't do this, the device will still try to capture GPS data however it will not know the time and hence, the data will not be relevant as there will be no time stamp along with it

To help, check out the below walk-through for setting up Losant:

You can also check out this video that describes the configuration and setup within Losant. The example in this video does not use the above code but should give you a good idea of how to setup and configure your equipment and their cloud to receive data:

Hope that helps, let us know how your progress

mc-Demo205 / Re: how I can to write and read data in the flash memory?
« on: August 02, 2017, 03:14:28 pm »
There is a log function that is not yet described in our documentation. In an upcoming release, we will be releasing this information within the new documentation for mcStudio and the mcDemo205. That said, we do have some code that you can modify for your use to log information into the flash of the device. The below code is for an example using our partner, Losant, so you may want to modify this for your needs. The code is meant to log GPS coordinates and temperature and then, when in range of a gateway, you would press SW1 and the information would then be transferred to the Losant cloud to populate onto a map onto a dashboard.

here is the code and there are also some additional notes below:

Code: [Select]
Class gpsTracker
    Shared Locations As ListOfObject
    Const GPS_TIMEOUT_uS As Integer = 120000000 '120s
    'Const GPS_TIMEOUT_uS As Integer = 1000000 '1s
    Const GPS_MIN_SATS As Integer = 3 '3 sattelites minimum
    Const LosantDeviceID As String = "YOUR LOSANT DEVICE ID"
    Const LosantTopic As String = "losant/" + LosantDeviceID + "/state"
    Shared Event Boot()
        Locations = New ListOfObject()
    End Event
    Shared Event StartLocationAcquisition() RaiseEvent Every 7 Minutes
        Led2 = True
        Led2 = False
        Device.StartGPS(GPS_TIMEOUT_uS, GPS_MIN_SATS)
    End Event
    Shared Event LocationDelivery()
        Dim lat As Float = Device.GetLatitude()
        Dim lon As Float = Device.GetLongitude()
        Dim tmp As Float = TempSensor.GetTemp()
        If lat.IsNaN() Or lon.IsNaN() Then
            Dim entry As ListOfByte = New ListOfByte()
            Log.Write(0, entry)
        End If
    End Event
    Shared Event SW1FallingEdge()
        Led3 = True
        Led3 = False
        Dim count As Integer = 0
        Dim offset As Integer = 0
        Dim lo As ListOfObject
        lo = Log.Read(offset)
        While lo <> Nothing
            Dim o As Object
            o = lo(0)
            offset = o.Cast(Integer)
            o = lo(1)
            Dim dtm As DateTime = o.Cast(DateTime)
            o = lo(2)
            Dim type As Integer = o.Cast(Integer)
            o = lo(3)
            Dim entry As ListOfByte = o.Cast(ListOfByte)
            Dim tmp As Float = entry.ExtractFloat(0)
            Dim lat As Float = entry.ExtractFloat(4)
            Dim lon As Float = entry.ExtractFloat(8)
            Dim jDate As Json = New Json()
            jDate.Add("$date", dtm)
            Dim jData As Json = New Json()
            jData.Add("temperature", tmp)
            Dim locStr As String = lat.ToString() + "," + lon.ToString()
            jData.Add("location", locStr)
            Dim jPayload As Json = New Json()
            jPayload.Add("time", jDate)
            jPayload.Add("data", jData)
            While Not Lplan.Publish2(LosantTopic, jPayload.ToListOfByte)
            End While
            count += 1
            If count = 30 Then
                count = 0
            End If
            lo = Log.Read(offset)
        End While
    End Event
End Class

Additional notes -

1) you'll also want to add the temperature sensor library and the below GPS library if you want to use the code above with Losant:
Code: [Select]
Class GpsLocation
    Public Latitude As Float
    Public Longitude As Float
    Public Timestamp As DateTime
    Public Sub New(lat As Float, lon As Float, dtm As DateTime)
        Latitude = lat
        Longitude = lon
        Timestamp = dtm
    End Sub
End Class

2) I believe the flash will keep storing until you have enough data to start overwriting. If you do want to clear the flash, you can include or run the below function on a new script
Code: [Select]
3) if you are interested in working with the above code for a test, keep in mind that the device needs to be powered and in-range of an mcGateway for a suggested 30 minutes to ensure that the device grabs the time from the gateway. This is so that you can associated a time with the GPS coordinates

4) And, if you are going to use the above code and leave it unmodified to work with Losant, you'll notice at the end of the code that we have a time delay. This is due to how the Losant platform works which can only consumer a certain amount of data every 30 seconds. The time delay allows the device to send out a batch of data then wait and keep sending to ensure that Losant receives all the messages.

Hope that helps!

Hi Bill,

Very interesting use-case. A video would be a great way to explore this however, we are in the midst of a couple of projects that are taking most of our time currently - we will not be able to make a video to help here.

That said, if you could provide some additional information, maybe someone from the community could help you out with some programming or suggestions for your use-case. It would help if:
- you could provide details on exactly how you envision your setup (alerts, what do you want the water heater to do and when, etc)
- provide information (maybe even pictures) of the hardware/equipment you have and what you would like to do
- any other details that might help some of the mcThings users to help you out

As you work through the project, our team and other users can help to answer questions here on the forum


Can you post a screen shot of the device menu (showing your gateway IP) please?

Also, a screenshot of the error would help too


Hi bdevlin,

Just to confirm on where you are at with everything:

The mcMod110 should be at: V0.9.615
The mcGateway110 should be at V0.9.615
Can you confirm that you are the latest version of mcStudio (V0.9)?

Can you take a screenshot of the 'device menu' where you connect to your gateway - just want to check that it is on the same subnet

And finally, can you try connecting to the gateway a couple of times (disregard the error) and see if this works as well please?

MQTT / Re: Setting up MQTT on pi and gateway
« on: July 04, 2017, 02:00:15 pm »
There were a couple of users that were discussing using Pi's as middle men - not sure the status of this.

Anyone out there that has done this that can help Bernstein?

As mcJohn mentioned, you can also forward the information to a service like CloudMQTT as an option. They do have a free tier and there are other ones out there as well. To help, you can check out this video that walks-through setting up CloudMQTT as a service. On this video we subscribe to the topic on an Android phone to view the data so not quite what you are looking to do but hopefully it helps a bit (CloudMQTT stuff starts around the 0:50 mark)

mc-Studio / Re: mcStudio Connection Error
« on: June 27, 2017, 09:29:00 am »

This is a rare error and it can happen if the ports that mcStudio uses to communicate are not opened.

mcStudio requires ports 25452 for both UDP and TCP to work properly. This is how mcStudio talks to an mcGateway and the virtual gateway. These ports should be opened during installation of mcStudio however, depending on your network/security setup, these ports may not be opened or are closed after installation.
These ports do need to be opened to work with the application

mc-Gateway / Re: Unable to connect to Losant via gateway
« on: June 27, 2017, 09:26:51 am »
hmm, it is pretty straighforward. I find that the usual issue is information inserted into the wrong field and/or case sensitive mistakes.

Check out this video where we go through the whole process of setting up MQTT and sending information to an android client:

mc-Gateway / Re: Updated gateway now connection problems
« on: June 27, 2017, 09:09:34 am »
After entering the SSID and password, make sure you power cycle the gateway so that those changes take affect.

Can you try this and let us know?

mc-Gateway / Re: Cannot see the gateway in mcStudio
« on: June 26, 2017, 02:48:57 pm »
Hey Veleek,
Ok, thanks for the details.

I am sending you a note directly to get you details as we'll need to see your existing gateway back at our office to assess what the issue could be. Keep an eye on your email please

mc-Gateway / Re: Cannot see the gateway in mcStudio
« on: June 26, 2017, 10:54:09 am »
Hi Veleek,

Can you use the mcDongle to update your other devices? Just want to confirm that the dongle is still working properly.

Has anything changed on your network since you were able to work with the platform? Any security changes, new router, etc?

The PC and the gateway need to be on the same subnet to communicate - can you confirm this?

mc-Gateway / Re: Updated gateway now connection problems
« on: June 26, 2017, 10:51:12 am »
Have you been connecting to WIFI using WPS? If so, please try that again.

You can also enter your SSID and password into the gateway configuration when connected via Ethernet. This way, your gateway will always connect to your WIFI network.

This YouTube video should help you out too

let us know if that helps

mc-Gateway / Re: Unable to connect to Losant via gateway
« on: June 26, 2017, 10:48:55 am »
Hi Bailejor,

Can you confirm that you have entered the correct information into the gateway?
Everything in Losant is case-sensitive so you need to ensure that you have entered the correct information into the gateway. This involves ensuring that the secret keys and access keys are entered correctly and you also need to enter the correct device ID.

I would suggest going through the getting started guide again and you can also check out this YouTube video that may help you out:

Let us know if that helps

Pages: 1 2 [3] 4 5 ... 17