Beagle Board - beagleboard.org
Mala Dies
Published

Dweet.io and the BBBW

Did you want to see different aspects in a visual manner w/out Matplotlib or Numpy on ARM devices?

BeginnerProtip1 hour84
Dweet.io and the BBBW

Things used in this project

Story

Read more

Schematics

BBBW

Use the power of Linux! Oh and Python3!

Code

UUID and Dweet.io

Python
You might need to install requests and psutil.
import requests, psutil, os

import time
import datetime

thing_name = "UUID"

def dweet(thing, **vals):
    url = "http://dweet.io/dweet/for/{}".format(thing)
    requests.post(url, params=vals)

def get_uptime():
    with open("/proc/uptime", "r") as f:
        raw = f.read()
    seconds = float(raw.split()[0])
    return seconds

while True:
    uptime = get_uptime()
    uptime_datetime = datetime.datetime.fromtimestamp(uptime)
    uptime_datetime.strftime("%H:$M:$S")

    load = psutil.cpu_percent(interval=2)
    mem = psutil.virtual_memory()[2]

    dweet(thing_name, uptime=uptime, cpu_load=load, memory=mem)

Credits

Mala Dies

Mala Dies

11 projects • 1 follower
Stay there and someone will find you...
Thanks to #beagle at Freenode and Some book in time...I cannot remember and I cannot find the book to share attribution right now. .

Comments

Add projectSign up / Login