• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. ncollins
    3. Best
    N
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 7
    • Groups 0

    Posts

    Recent Best Controversial
    • Batch push sensor data once network is available

      I'm running MyController on an orangePi on my local network at home. It's working great at home and I'd like to build a similar network in my old Jeep. I would run an orangePi with a separate mycontroller install in the Jeep. When the Jeep is within range of my home wireless network, it would push all of the data collected since the last successful push to the primary MyController (master) install.

      I haven't completely thought this through, but I'm thinking the sync would only need to go in one direction, but there might be some data or configs that I would like to push to the Jeep.

      In the Jeep, I'd probably want the full MyController install to display an LCD dashboard of all of my sensor data (inside temp, outside temp, car battery voltage, compass, accelerometer, gyros, gps, mpg, speedometer). Once the data is synced with the primary (house based) MyController install, I would make different views to display things like which cars are home, last trip info, battery info.

      I've considered using a 3G module to create a cellular gateway but I really don't need constant connection, I don't want to pay for sim cards and monthly service or reloads. Also, it's possible my vehicle goes out of service area, which means I still need a way to sync data collected while offline. Even in that case, I would rather find a way to push that data through my cellphone.

      Final thought: While my primary use case is collecting vehicle data, I'm also thinking this might work for wearables. It would be amazing to create a tiny wearable network to collect biometric data and/or environment data, then push that when the network is available. (or a pet tracker).

      I'd really appreciate your thoughts and feedback. Thank you.

      posted in Developers Zone
      N
      ncollins
    • RE: Triggering rule through the HTTP request

      @Daniele This is an example for a node.js script that I use to pull back sensor data.

      const https = require('https');
      
      https.get({
      	host: 'localhost' // host of your mycontroller install
      	,port: 443 // this is 443 since it's SSL
      	,path: '/mc/rest/sensors/264' // example getting sensor info for sensor 264
      	,headers: {
      		'Authorization': 'Basic ' + new Buffer('USERNAME:PASSWORD').toString('base64')
      	}
      
      }, (resp) => {
        let data = '';
        //console.log(resp);
        // A chunk of data has been recieved.
        resp.on('data', (chunk) => {
          data += chunk;
        });
      
        // The whole response has been received. Print out the result.
        resp.on('end', () => {
          console.log(JSON.parse(data).variables[0]);
        });
      
      }).on("error", (err) => {
        console.log("Error: " + err.message);
      }); 
      

      Important thing to note is the Basic Auth header. This is how you send username and password.

      The first google result I found for sending basic auth params in a python script
      https://stackoverflow.com/questions/6999565/python-https-get-with-basic-authentication

      import requests
      
      r = requests.get('https://my.website.com/rest/path', auth=('myusername', 'mybasicpass'))
      print(r.text)
      
      posted in General Discussion
      N
      ncollins
    • RE: Request: Make all graph x-axis a consistent range [current time - (hour,day,week...), current time]

      GitHub: nikolac

      Thanks for responding!

      posted in Developers Zone
      N
      ncollins