3 ms·
> Can there really be people that are willing and able to build their own IOT but do not want to learn about Linux? Absolutely, and especially in corporate env
by nbadg 11y ago
> Can there really be people that are willing and able to build their own IOT but do not want to learn about Linux?
Absolutely, and especially in corporate environments. I'm not saying Windows 10 IoT is any better (I think it's very unlikely to be, but I also haven't evaluated it), but I can say for certain that I wish I had a single, identical python library for any IoT platform that handled interfaces as simply as:
with pin_1 as p1:
p1.output(1)
time.sleep(2)
p1.output(0)
Now, there are some libraries that approach that level of simplicity once you have your system configuration set up, but that doesn't lend itself to agile development. I want something that works like that out-of-box -- flash it, load code, press go button -- which simply doesn't exist. And, after spending a lot of time writing my own hardware IO library using direct memory access in Python, I don't think there's an OS out there that's capable of doing it (yet). I've spent just way too much time accommodating unfortunate abstractions taken at the linux kernel level (that I understand for historical reasons, but disagree with for future ones). An operating system for IoT done right is, in my opinion, a very lightweight exokernel with some really smart abstractions that just gets out of your way. Then you need a clever (and native) secure networking system, and you're in very good shape.
- nitrogen 11y agoHow does Arduino (which I've never used) compare to your desired Python library?
- netik 11y agoI'm not sure if you've dealt with Arduino in Processing, but it is exactly as you describe. void loop() { digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(1000); // waits for a second }
- nbadg 11y agoArduino is awesomely easy in this regard, but lacks a proper operating system, and the individual pins have fewer modes than systems on a chip. That is, in a way, exactly my point: the operating systems we have are so bad at portable systems that going without one can actually make development easier. That's a big problem.
- netik 11y agoI think this is a 'right tool for the job' problem. Frequently you don't need an operating system to do basic tasks. I don't see this as a problem at all for simple things to a point. Even something that seems as complex as as reading a sensor and writing data out to a CF card doesn't require an OS if the basic library support is there.
- tracker1 11y agoIf you use BabelJS (ES6) you can write async methods that are very close to that with Node + johnny-five. https://github.com/rwaldron/johnny-five https://github.com/rwaldron/johnny-five
- teekert 11y agoLike this? from time import sleep import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(2, GPIO.OUT) while 1: GPIO.output(2, False) sleep(2) GPIO.output(2, True) Perhaps I'm not understanding what you want exactly, you seem to know what you're doing.
- nbadg 11y agoThe problem is in pinmuxing. If you want to change the pins from their default modes, you're in for a world of pain. Systems on a chips (SoCs, basically run everything portable these days) are optimized to the point where different die pins can have different modes (GPIO, LCD framing, USB framing, might all be available, one at a time, on the same pin). Switching between them requires mucking about in the kernel and reconfiguring hardware and is, at least in my experience, incredibly painful. Also, the sysfs mappings that the easy bindings tend to be written from are very, very slow (like ~3+ orders of magnitude slower than they should be: http://hackaday.com/2013/12/07/speeding-up-beaglebone-black-gpio-a-thousand-times/ http://hackaday.com/2013/12/07/speeding-up-beaglebone-black-...).