公有iot私有iot架构

I've been playing with IoT stuff on my vacation. Today I'm looking at an Onion Omega. This is a US$19 computer that you can program with Python, Node.js, or C/C++. There's a current IndieGogo happening for the Onion Omega2 for $5. That's a $5 Linux computer with Wi-Fi. Realistically you'd want to spend more and get expansion docks, chargers, batteries, etc, but you get the idea. I got the original Omega along with the bluetooth dongle, Arduino compatible base, tiny OLED screen. A ton of stuff to play with for less than $100.

我在度假时一直在玩物联网的东西。 今天我正在看洋葱欧米茄。 这是一台19美元的计算机,您可以使用Python,Node.js或C / C ++进行编程。 目前,IndieGogo正在以5美元的价格出售Onion Omega2 。 那是一台售价5美元的带Wi-FiLinux计算机。 实际上,您希望花费更多,并获得扩展坞,充电器,电池等,但是您明白了。 我得到了原始的Omega以及蓝牙加密狗,与Arduino兼容的底座,小的OLED屏幕。 一吨不到100美元的东西就可以玩。

Note that I am not affiliated with Onion at all and I paid for it with my own money, to use for fun.

请注意,我完全不隶属于洋葱,我用自己的钱付了钱,用来娱乐。

One of the most striking things about the Onion Omega line is how polished it is. There's lots of tiny Linux Machines that basically drop you at the command line and say "OK, SSH in and here's root." The Onion Omega is far more polished.

关于洋葱欧米茄系列最引人注目的事情之一是它的抛光程度。 有很多小Linux机器,它们基本上会在命令行中显示“ OK,SSH in and roots”。 洋葱欧米茄(Omega)要抛光得多。

The Omega can do that for you, but if you have Bonjour installed (for zeroconf networking) and can SSH in once to setup Wi-Fi, you're able to access this lovely web-based interface.

Omega可以为您做到这一点,但是如果您安装了Bonjour(用于Zeroconf网络)并且可以通过SSH一次来设置Wi-Fi,则可以访问此基于Web的漂亮界面。

This clean, local web server and useful UI makes the Onion Omega extremely useful as a teaching tool. The Particle line of IoT products has a similarly polished web-interfaces, but while the Onion uses a local web server and app, the Particle Photon uses a cloud-based app that bounces down to a local administrative interface on the device. There's arguments for each, but I remain impressed with how easy it was for me to update the firmware on the Omega and get a new experience. Additionally, I made a few mistakes and "bricked" it and was able - just by following some basic instructions - to totally reflash and reset it to the defaults in just about 10 minutes. Impressive docs for an impressive product.

这种干净的本地Web服务器和有用的UI使Onion Omega作为教学工具极为有用。 IoT产品的Particle系列具有类似的抛光Web界面,但是Onion使用本地Web服务器和应用程序时,Particle Photon使用基于云的应用程序,该应用程序可以跳回到设备上的本地管理界面。 每种都有争论,但是我对Omega上的固件更新和获得新体验的简易性印象深刻。 另外,我犯了一些错误并“变砖”了它,只需遵循一些基本说明,就可以在大约10分钟内完全重新刷新并将其重置为默认值。 令人印象深刻的产品的令人印象深刻的文档。

通过NightScout实现基于洋葱Omega的葡萄糖显示 (Onion Omega based Glucose Display via NightScout)

So it's a cool product, but how quickly can I do something trivial, but useful? Well, I have a NightScout open source diabetes management server with an API that lets me see my blood sugar. The resulting JSON looks like this:

所以这是一个很酷的产品,但是我多快可以完成一些琐碎但有用的事情? 好吧,我有一个NightScout开源糖尿病管理服务器,该服务器带有一个API,可让我查看血糖。 生成的JSON如下所示:

[     {        "_id":"5851b235b8d1fea108df8b",      "sgv":135,      "date":1481748935000,      "dateString":"2016-12-14T20:55:35.000Z",      "trend":4,      "direction":"Flat",      "device":"share2",      "type":"sgv"   }]

That number under "sgv" (serum glucose value) is 135 mg/dl. That's my blood sugar right now. I could get n values back from the WebAPI and plot a chart, but baby steps. Note also the "direction" for my sugars is "flat." It's not rising nor falling in any major way.

“ sgv”(血清葡萄糖值)下的数字为135 mg / dl。 那是我现在的血糖。 我可以从WebAPI中获取n个值并绘制图表,但是很简单。 另请注意,我的糖的“方向”是“扁平”。 它没有以任何主要方式上升或下降。

Let's add the OLED Display to the Onion Omega and show my sugars. Since it's an OpenWRT Linux machine, I can just add Python!

让我们将OLED显示器添加到洋葱Omega并显示我的糖。 由于它是一台OpenWRT Linux计算机,因此我可以添加Python!

opkg updateopkg install python

Some may (and will) argue that for a small IoT system, Linux is totally overkill. Sure, it likely it. But it's also very productive, fun to prototype with, and functional. Were I to go to market for real, I'd likely use something more hardened.

有些人可能(并且会)争辩说,对于小型物联网系统,Linux完全过时了。 当然可以。 但这也非常有生产力,具有原型制作的乐趣并且功能强大。 如果我要真正进入市场,我可能会使用更坚固的东西。

As I said, I could SSH into the machine but since the Web UI is so nice, it includes an HTML-based terminal!

如我所说,我可以通过SSH进入计算机,但是由于Web UI非常好,因此它包含一个基于HTML的终端!

The Onion Omega includes not just libraries for expansions like the OLED Display, but also command-line utilities. This script clears the display, initializes it, and displays some text. The value of that text will come from my yet-to-be-written python script.

Onion Omega不仅包括用于OLED Display之类的扩展库,还包括命令行实用程序。 该脚本清除显示,对其进行初始化,并显示一些文本。 该文本的值将来自我尚未编写的python脚本。

#!/bin/sh    

oled-exp -c  

VAR=$(python ./sugar_script.py)

oled-exp -i  oled-exp write "$VAR"

Then in my Python script I could print the value that would be returned into VAR and then printed with the oled-exp command line utility.

然后,在我的Python脚本中,我可以打印将返回到VAR中的值,然后使用oled-exp命令行实用程序进行打印。

OR, I can bypass the shell script entirely and use the Python Module for this OLED screen directly and do this. Grab the JSON, clean it up because apparently the json library sucks (?), then display it.

或者,我可以完全绕过shell脚本,并直接将Python模块用于此OLED屏幕并执行此操作。 抓取JSON,清理它,因为显然json库很烂(?),然后显示它。

#!/usr/bin/env python                                                                                                        

from OmegaExpansion import oledExp                                                                                           import urllib                                                                                                                import json                                                                                                                  

site="https://hanselmansugars.something/api/v1/entries/sgv.json?count=1"                                                jfile=urllib.urlopen(site)                                                                                                   jsfile=jfile.read()                                                                                                          jsfile=jsfile.replace("\n","")                                                                                               jsfile=jsfile.replace("/","")                                                                                                jsfile=jsfile.replace("]","")                                                                                                jsfile=jsfile.replace("[","")                                                                                                

a=json.loads(jsfile)                                                                                                         sugar=a['sgv']                                                                                                               direction=a['direction']                                                                                                     info="\n" + str(sugar)+" mg/dl and "+direction                                                                               

oledExp.driverInit()                                                                                                         oledExp.clear()                                                                                                              oledExp.write(info)    

Now here's a pic of my live blood sugar on the Onion Omega with the OLED! I could put this to run on a timer and I'm off to the races.

现在,这是我在带OLED的Onion Omega上的活血糖的照片! 我可以将其放在计时器上运行,然后开始比赛。

The next step might be to clean up the output, parse the date better, and perhaps even dynamically generate a sparkline and display the graphic on the small B&W OLED Screen.

下一步可能是清理输出,更好地解析日期,甚至可能动态生成迷你图,并在小型B&W OLED屏幕上显示图形。

Have you used a small Linux IoT device like the Onion Omega?

您是否使用过像Onion Omega这样的小型Linux IoT设备?

翻译自: https://www.hanselman.com/blog/playing-with-an-onion-omega-iot-device-to-show-live-blood-sugar-on-an-oled-screen

公有iot私有iot架构

公有iot私有iot架构_玩洋葱Omega IoT设备在OLED屏幕上显示实时血糖相关推荐

  1. 计算机游戏中屏幕上显示的,电脑在玩全屏游戏的时候显示屏老是出现无信号

    公告: 为响应国家净网行动,部分内容已经删除,感谢读者理解. 话题:电脑在玩全屏游戏的时候显示屏老是出现无信号 问题详情:我在玩CF的时候 每次进入游戏 显示屏突然出现无信号 好几次了推荐回答:这样的 ...

  2. IOT物联网技术架构_物联网平台架构设计

    现在网上讨论的有关物联网的帖子非常之多,但大部分都是介绍理论或者有关硬件,通讯相关的问题,比如物联网模块,物联网通讯协议MQTT.XMPP.NB_IOT等,个人认为这些只是物联网中一部分,而涉及到物联 ...

  3. 安卓开机画面_谷歌要求所有安卓设备加入quot;屏幕使用时间quot;等功能

    据外媒报道,在过去一年半时间里,谷歌始终在推动名为"数字健康"(Digital WellBeing)的计划,以帮助所有人以更健康的方式使用手机.现在,谷歌要求所有安卓设备都需要有某 ...

  4. adc的使用屏幕上显示单位v。显示结果精确到小数位后3位。_为什么要关注示波器 ADC 位数或者是 ENOB?- 了解信号的完整性...

    IEEE在1993年将有效位数(ENOB) 确立为衡量示波器信号完整性和精度的技术指标. 示波器ADC 位数与有效位数 示波器中的模数转换器(ADC)位数是最广为人知的技术指标之一.许多工程师将它视为 ...

  5. java打印星号_【其它】编写Java程序在屏幕上打印用星号组成的等腰三角形

    参考答案如下 编写[多选题]文学象征的特征有() 程序成[简答题]Translate the above passage into Chinese to get more precisely what ...

  6. 计算两个数之间所有整数的和_汇编语言:输入2个0–99之间的整数,对其做乘法运算,在屏幕上显示出该乘积对应的二进制和十六进制数...

    实验要求: (1)在屏幕提示:"please input the first number(0–99): "后,输入一个0–99之间的整数. 若所输入的数不在此范围内,或输入其它字 ...

  7. 扩展 日历_日历功能的拓展:Apple Watch能在屏幕上显示年日历

    集微网消息,之前从网上看见许多苹果的粉丝希望Apple Watch的日历功能可以得到扩展,以便在某个时间点向用户显示年度日历视图. 而本周苹果公布的一项专利正为我们提供了一个扩展的日历视图,使用数字表 ...

  8. python围棋程序在屏幕上找棋盘_用C语言编程 在屏幕上显示围棋棋盘

    展开全部 -- 以怎么不用 MS VC++6 ?? 编C语言一般都用啊 还有\xCD是C语言 Ascii代码 表示一个图形 用循环32313133353236313431303231363533e58 ...

  9. java 自定义报表_设计好的报表是如何在 web 上显示的

    润乾报表主要用来开发在 java web 端呈现的报表工具,设计器为桌面版,那么开发后的报表如何发布到 web 端是用户较为关心的问题. 润乾报表 web 端发布,采用 Taglib 方式,只需要在 ...

最新文章

  1. 图像的读取,显示与保存(基于skimage模块)
  2. 牛红红的日记(平平无奇拿下域控)
  3. java 反射机制_详解Java中的反射机制的优缺点
  4. SAP CRM WebClient UI,点击Master Data工作中心后执行的JavaScript代码
  5. CRM Set Type com_commercial的UI界面
  6. LAMP+LNMP(一) LAMP架构概述
  7. 某公司PIX 520防火墙系统和NAT的实施
  8. 接口规范 9. 推流认证相关接口
  9. 自监督学习推荐系统综述: 150篇自监督推荐系统文献概述四大类方法(含开源算法库SELFRec)...
  10. 交互式电子杂志_电子杂志形式与交互问题分析
  11. 电脑开机主板报警1长2短是怎么回事?
  12. E盾网络验证V60原版复活版包含已经改好的复活版服务端小白直接替换加密一机一码
  13. 百度地图 前端html,前端js调用百度地图常用基本功能
  14. https://www.jb51.net/article/146628.htm
  15. 一款非常nice的国产U盘启动制作工具——Ventoy
  16. 光和颜料中的三原色,美术中的三原色
  17. MySQL 最新版行政区划
  18. iomanip I/O流类库操纵符
  19. 【华为上机真题】相对开音节
  20. Win7系统IE浏览器提示网站还原错误怎么解决?

热门文章

  1. idea debug教程启用Debug模式可以分析定位异常发生的位置
  2. 错排公式的理解与推导(转载)
  3. 维吉尼亚密码加密/解密在线工具
  4. iOS开发storyboard拖拽tableView: Static cells的使用
  5. ios模拟器 - Simulator录制视频
  6. 新收集的WAPPUSH代码,并经过改造
  7. mysql 唯一更新_MySQL 唯一索引和插入重复自动更新
  8. 本体技术视点 | 数据的去中心化协作和可信流动(一)
  9. CodeVS4416 FFF 团卧底的后宫
  10. 逻辑推理题的思路规律