CreationDate
stringlengths
23
23
Answer
stringlengths
60
24k
Tags
stringlengths
5
68
Title
stringlengths
15
140
Id
stringlengths
1
4
Body
stringlengths
106
19.3k
2018-03-10T17:54:45.863
<p>The existing answer isnt quite correct in its conclusion. You cant make the dimmer see a toggle switch as momentary. Sure, you can configure it to be momentary, but it's still a toggle switch. And the problem just changes, it does not go away.</p> <p>The solution is to use a momentary switch.</p> <ul> <li>Every time the switch is pressed, it toggles the light.</li> <li>If the switch is held down, the light intensifies. And you release it at the desired brightness The next time it is held down, the light dims.</li> <li>If the switched is pressed twice the light goes to max brightness.</li> </ul>
|dimmer|
How to use Aeotec Nano Dimmer with a SPST switch?
2715
<p>I have an Aeotec Nano Dimmer, and am trying to understand how to dim lights using an external SPST switch connected to it.</p> <p>If I toggle the switch the lights go on and off.</p> <p>If I toggle it and then toggle it back instantly, the light level starts to change, but it seems quite erratic: I can't reliably stop it.</p> <p>The documentation is silent about it.</p>
2018-03-13T00:00:25.003
<blockquote> <p>can't I have "something" that receives the data and sends them over ip-based networks?</p> </blockquote> <p>Yes you can and that's called a gateway.</p> <p><a href="https://www.lora-alliance.org/technology" rel="noreferrer">https://www.lora-alliance.org/technology</a></p> <p><a href="https://www.thethingsnetwork.org/docs/gateways/" rel="noreferrer">https://www.thethingsnetwork.org/docs/gateways/</a></p> <p>These services like Things Network and Loriot.io provide software for the gateways, cloud servers (a backend) and API's. You don't need to use them, they just make your life easier, and I believe most services that The things network provide are free.</p>
|lora|lorawan|
Lo.Ra and Lo.RaWan: Why is a gateway needed?
2717
<p>As I was looking information regarding Lo.Ra and Lo.RaWAN over these links:</p> <ul> <li><a href="http://www.instructables.com/id/Introducing-LoRa-/" rel="nofollow noreferrer">http://www.instructables.com/id/Introducing-LoRa-/</a></li> <li><a href="https://www.link-labs.com/blog/what-is-lora" rel="nofollow noreferrer">https://www.link-labs.com/blog/what-is-lora</a></li> <li><a href="https://www.quora.com/What-is-the-difference-between-Lora-and-LoraWan" rel="nofollow noreferrer">https://www.quora.com/What-is-the-difference-between-Lora-and-LoraWan</a></li> <li><a href="https://www.link-labs.com/blog/what-is-loraw" rel="nofollow noreferrer">https://www.link-labs.com/blog/what-is-loraw</a></li> </ul> <p>I also have looked many tutorial sites on how to setup a Lo.Ra gateway:</p> <ul> <li><a href="https://www.hackster.io/ChrisSamuelson/lora-raspberry-pi-single-channel-gateway-cheap-d57d36" rel="nofollow noreferrer">https://www.hackster.io/ChrisSamuelson/lora-raspberry-pi-single-channel-gateway-cheap-d57d36</a></li> <li><a href="https://electronza.com/raspberry-pi-cheap-lora-gateway/" rel="nofollow noreferrer">https://electronza.com/raspberry-pi-cheap-lora-gateway/</a></li> </ul> <p>But all these material made me quite nervous and generated me these questions:</p> <ul> <li>Why a Lo.Ra gateway is needed?</li> <li>Why is needed to get registered in sites like: <a href="https://www.thethingsnetwork.org/" rel="nofollow noreferrer">https://www.thethingsnetwork.org/</a></li> </ul> <p>I solely cannot understand their purpose of having a registered gateway, can't I have "something" that receives the data and sends them over ip-based networks eg. via ethernet cable without the need of registration in <a href="https://www.thethingsnetwork.org/" rel="nofollow noreferrer">https://www.thethingsnetwork.org/</a> ?</p>
2018-03-13T13:42:06.150
<p>It wouldn't be much of a Wide Area Network (WAN) if you just had a single gateway.</p> <p>While you can certainly have nodes report into a single gateway, the more expansive schemes (for example, The Things Network) let multiple gateways coordinate through traditional Internet links, either by all reporting up to a single server or better yet into a network of cooperating servers.</p> <p>This means the network can extended beyond the radio horizon of a single gateway, and instead be the union of the radio horizons of <em>all</em> the gateways cooperating in the network. </p> <p>For something like The Things Network, that means a bunch of bubbles, often clustered in specific areas, but collectively scattered all around the world (though the frequencies authorized for use do differ by region).</p> <p>So in the end the question of "is it needed" comes down to "what do you want to do?" If a single gateway meets your needs and you can run whatever needs to interact with nodes on that gateway's computer or on clients that connect to it, then no, you don't need another server. But if you want to leverage multiple gateways, you'll need some sort of server infrastructure to help them collaborate.</p>
|lorawan|
Lo.RaWAN: Why a network server is needed?
2720
<p>As I continue my quest to the Lo.RaWAN I am looking over some tutorials on how to setup a Raspberry Pi Lo.RaWAN gateway so far I found these:</p> <ul> <li><a href="https://docs.mbed.com/docs/lora-with-mbed/en/latest/intro-to-lora/" rel="nofollow noreferrer">https://docs.mbed.com/docs/lora-with-mbed/en/latest/intro-to-lora/</a></li> <li><a href="https://www.hackster.io/ChrisSamuelson/lora-raspberry-pi-single-channel-gateway-cheap-d57d36" rel="nofollow noreferrer">https://www.hackster.io/ChrisSamuelson/lora-raspberry-pi-single-channel-gateway-cheap-d57d36</a> etc etc</li> </ul> <p>Also I have searched information regarding the topology and I found this link: <a href="http://www.radio-electronics.com/info/wireless/lora/lorawan-network-architecture.php" rel="nofollow noreferrer">http://www.radio-electronics.com/info/wireless/lora/lorawan-network-architecture.php</a></p> <p>While I was studying the information provided in links, I noticed that they need something called "Network Server" that either can be your own implementation such as: <a href="https://github.com/brocaar/loraserver" rel="nofollow noreferrer">https://github.com/brocaar/loraserver</a> or provided as a service such as <a href="https://www.thethingsnetwork.org" rel="nofollow noreferrer">https://www.thethingsnetwork.org</a>.</p> <p>So far I understood that the network server actually does the network management through the gateways.</p> <p>But I cannot understand why is needed a "network server", I mean why do I need a service to manage the Lo.RaWAN network using a special server? </p> <p>In other words cannot figure out the reason why the Designers of Lo.RaWAN thought: "OK let the gateway send the trafic into a Network Server"</p>
2018-03-16T12:54:51.700
<blockquote> <p>If your node devices already speak IP protocols, have a reasonable amount of volatile and non-volatile storage, and have an outgoing network connection they should be able to connect directly with an MQTT broker. But if they use some other radio standard like zigbee then you'd need a gateway. Note that a "gateway" often need be little more than a process running on a box - you could likely add this to a customizable WiFi router for example, or an existing on-site server. You probably would not want to use a Raspberry Pi in a permanent installation or deployment. - @Chris Stratton</p> </blockquote>
|mqtt|eclipse-iot|
Eclipse solutions without a gateway
2731
<p>I'm currently reading the Eclipse IoT documents for a big scale company. Knowing that having a Raspberry as a Gateway means more costs, do you guys think that Eclipse solutions for a MQTT connection will work without a gateway?</p>
2018-03-16T13:00:04.920
<p><strong>In general, no — there aren't any standards for topic naming beyond the MQTT specifications</strong>.</p> <p>There are <a href="https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices" rel="noreferrer">plenty of opinions</a> about how you should construct your MQTT topics, and <a href="https://iot.stackexchange.com/q/966/12">not a lot of fixed rules</a>. While this is a bit unsettling when you'd like to know exactly what the best practice is, the lack of strict rules does mean you get a lot of flexibility with an MQTT broker.</p> <p>As you're using Home Assistant, this narrows things down a bit, but more specifically, the topics you're looking at are specific to your Sonoff switch. The API is described <a href="https://github.com/arendst/Sonoff-Tasmota/wiki/MQTT-Overview" rel="noreferrer">in this wiki</a>:</p> <blockquote> <ul> <li><p><strong>Message</strong>: cmnd</p> <ul> <li><p><strong>Issued by</strong>: devices shown on the right hand side</p> </li> <li><p><strong>Intent</strong>: control the Sonoff; set configuration; ask for status</p> </li> </ul> </li> <li><p><strong>Message</strong>: stat</p> <ul> <li><p><strong>Issued by</strong>: the Sonoffs on the left hand side</p> </li> <li><p><strong>Intent</strong>: report back status or configuration message</p> </li> </ul> </li> <li><p><strong>Message</strong>: tele</p> <ul> <li><p><strong>Issued by</strong>: some Sonoffs (like temperature measuring devices)</p> </li> <li><p><strong>Intent</strong>: report unsolicited telemetry info at periodic intervals</p> </li> </ul> </li> </ul> </blockquote> <p>The diagram referred to is <a href="https://camo.githubusercontent.com/0533face4144436d30d7902480afd969c7fad276/687474703a2f2f616c742e70626569726e652e636f6d2f696d616765732f736f6e6f66665f636d6e645f666c6f77322e706e67" rel="noreferrer">here</a>, although it is best viewed in the wiki page linked above.</p> <p><em>In general</em>, any hierarchy used will be manufacturer or system specific; Sonoff devices will generally follow a documented MQTT topic structure, and other manufacturers might use something different. Not all manufacturers will document their products well (or at all!) — so take care when buying products.</p>
|mqtt|communication|mosquitto|
Are there standardized MQTT topics?
2732
<p>I am new to MQTT (and home automation in general, I am much more in the systems and dev side), flashed a WiFi switch (Sonoff Basic), connected it to an instance of Mosquitto and Home Assistant and so far everything works fine.</p> <p>When monitoring the Mosquitto bus, I see all kind of messages, such as</p> <pre><code>tele/hass1/LWT Online tele/home/room1/switch1/LWT Online cmnd/home/room1/switch1/POWER OFF </code></pre> <p>I recognize <code>home/room1/switch1</code> which I defined on my WiFi switch, and the switch then sent some topics prefixed by <code>cmnd</code> (command? that would be surprising as nobody manipulated the switch) and <code>tele</code> (telemetry?). <code>tele/hass1/...</code> is generated by Home Assistant.</p> <p><strong>Are there any standards or commonly accepted practices for the prefixes?</strong></p> <p>The MQTT documentation explains <a href="http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718106" rel="noreferrer">how topics are formatted</a> but does not introduce any structure (except for topics beginning with <code>$</code>) so I guess that, best case, it would rather be a best practice (or practice full stop).</p>
2018-03-16T19:23:45.270
<p>The payload comes from the incoming message. It does not make sense to define a static payload in the <code>MQTT-out</code> node.</p> <p>The entry in the <code>node-settings</code> is just a mouse over label for the input, since nodes can only have 1 input it's not that useful, it's more for when nodes have multiple outputs to make it easier to identify which output is which.</p> <p>In the case you have posted a screen shot ofit will take the <code>msg.payload</code> output from the <code>http-in</code> node, which would be the body of a HTTP POST.</p> <p>If want to add a static payload to be published then the easiest way is to add a <code>change</code> node between the <code>http-in</code> and <code>mqtt-out</code> node. </p> <p>e.g. to set the payload to "foo"</p> <p><a href="https://i.stack.imgur.com/wW5XP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wW5XP.png" alt="enter image description here"></a></p> <p>You can set JSON objects by selecting the type from the drop down on the left hand end of the <code>to</code> field.</p>
|mqtt|node-red|
How to add payload to a posted MQTT topic?
2735
<p>I am experimenting with <code>node-red</code>, connecting it to my MQTT broker.</p> <p>The input (listening to a topic) works fine.</p> <p>I also would like to send to a topic some payload ipon some triggers. In the example below, this would be on a query to a webservice:</p> <p><a href="https://i.stack.imgur.com/CJPXb.png" rel="noreferrer"><img src="https://i.stack.imgur.com/CJPXb.png" alt="enter image description here"></a></p> <p><strong>I did not have a place to add the payload to the published message, where can I set it up?</strong></p> <p>The documentation mentions in the <em>inputs</em> section:</p> <blockquote> <p><code>payload</code></p> <p>most users prefer simple text payloads, but binary buffers can also be published.</p> </blockquote> <p>and later</p> <blockquote> <p><code>msg.payload</code> is used as the payload of the published message. If it contains an Object it will be converted to a JSON string before being sent. If it contains a binary Buffer the message will be published as-is.</p> </blockquote> <p>I tried to add <code>{msg: {payload: 'on'}}</code> or <code>{payload: 'on'}</code> in <em>node settings -> inputs</em> but the payload is not carried to the MQTT, which hows an incoming <code>cmnd/home/room1/switch1/power {}</code> </p> <p><a href="https://i.stack.imgur.com/nDRHB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nDRHB.png" alt="enter image description here"></a></p>
2018-03-19T18:57:40.693
<p>No</p> <p>MQTT is a lightweight protocol, it carries nothing in the headers except what is needed (Topic, QOS &amp; Retained flag).</p> <p>It also goes against the pub/sub philosophy that a publisher shouldn't know about who is subscribed to a given topic and a subscriber shouldn't care where the publisher is, just that the information was provided on a given topic.</p> <p>The only way would be to add the information to the payload yourself.</p>
|mqtt|mosquitto|
Can mosquitto publish the IP of clients?
2742
<p>I have several devices talking to my Mosquitto MQTT broker and when listening to incoming messages I get all relevant information except the IP of the subscribed client.</p> <p><strong>Is it possible to configure Mosquitto so that this information is provided together with the topic and payload?</strong></p> <p>This is a possible security issue if the ACLs are not configured properly so I can understand that the feature is disabled by default. In my case security is not a concern.</p>
2018-03-22T20:55:18.287
<p>Just to clarify from what I undestand when researching these modules:</p> <ul> <li>RFM<strong>69</strong>x - Packet Radio (<strong>not LoRa</strong>) </li> <li>RFM<strong>96</strong>x - LoRa Radio (or RFM95 / RFM97 - thanks <a href="https://iot.stackexchange.com/users/737/chris-stratton">Chris</a>)</li> </ul> <p>If you're trying to use an RF69x for LoRa, that's your issue</p> <p>A quick google search should show you how to get LoRaWan up and running if you have the correct radio module (RFM9xx).</p> <p>Hope this helps.</p> <p>(<a href="https://learn.adafruit.com/adafruit-rfm69hcw-and-rfm96-rfm95-rfm98-lora-packet-padio-breakouts/overview" rel="nofollow noreferrer">Link</a> to adafruit learn page for the radio modules I believe you are referring to)</p>
|lora|arduino|lorawan|
RFM69W and LoraWan
2757
<p>I'm trying to figure out how I will make an RFM69W LoRa Module work with The Things Network, so I looked over many tutorials, code samples, and libraries. The one I find closest to LoRaWan support is:</p> <p><a href="https://github.com/matthijskooijman/arduino-lmic" rel="nofollow noreferrer">https://github.com/matthijskooijman/arduino-lmic</a> because of LoRaWan support.</p> <p>But it seems that has a specific chipset support that may not be compatible with adafruit RFM69W.</p> <p>The one that mentioned in adafruit's site is just sending bulk data over an rf channel such as <a href="https://github.com/adafruit/RadioHead" rel="nofollow noreferrer">radiohead</a> and <a href="https://github.com/LowPowerLab/RFM69" rel="nofollow noreferrer">powerlab's</a> after a quick look over the libraries for arduino.</p> <p>Has anyone tried to use the chip with LoRaWan specs, if yes then how did you do it, which libraries did you use for arduino?</p>
2018-03-23T12:11:47.280
<p>Inside the Sonoff, there will be an AC to DC converter like <a href="https://www.amazon.in/Hi-link-HLK-PM03-Isolated-Supply-Module/dp/B01MQHMCC9" rel="nofollow noreferrer">Hi-link HLK-PM03 220V to 3.3V Step-Down Buck Isolated Power Supply Module</a> which is used to power the Wi-Fi module separately. As I have created the same Wi-Fi smart switch using a solid-state relay, ESP-12 generic module and simple LED within an AC-outlet and also created just like sonoff.</p> <p>If the Sonoff is directly connected to the power supply and at the output of sonoff the Lamps are connected in series, there will be no issue of Power Supply. </p> <p>And if the Power supply is given simultaneously to both Lamps in series and Sonoff then also there is no problem, I think.</p> <p>My circuit was like <a href="https://ibb.co/23rY5wH" rel="nofollow noreferrer">this</a>. For creating a small product as sonoff replace the solid-state relay with <a href="https://www.dnatechindia.com/image/cache/catalog/5v%20cube%20relay-500x500.jpg" rel="nofollow noreferrer">generic relays</a> and you will have a small custom product.</p>
|wifi|power-consumption|lighting|ac-power|
What is the working voltage range of a Sonoff Touch?
2760
<p>I would like to replace normal (mechanical) switches at home with <a href="https://www.itead.cc/sonoff-touch.html" rel="noreferrer">Sonoff Touch</a> ones, which I will be able to manage.</p> <p>Today I have this:</p> <p><a href="https://i.stack.imgur.com/rDpYp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/rDpYp.png" alt="enter image description here"></a></p> <p>and by adding the Sonoff Touch I will have that (P1 is the WiFi module, the whole dashed box is the Sonoff Touch):</p> <p><a href="https://i.stack.imgur.com/NWN7h.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NWN7h.png" alt="enter image description here"></a></p> <p>The concern I am having is that the lamp(s) which are in series with the switch will lower the voltage on the switch. I do not know yet by how much.</p> <p><strong>Are there practical indication on the voltage range required by a Sonoff Touch to function properly?</strong> (the documentation mentions 90~250V AC, I am more looking at some experience based cases)</p> <p><em>Circuit schematics thanks to <a href="https://www.circuitlab.com" rel="noreferrer">CircuitLab</a></em></p>
2018-03-25T08:21:49.560
<blockquote> <p>Are single boards always necessary when implementing an IoT connection?</p> </blockquote> <p>No, Single Board Computers aren't necessary. Single Board Computers provide a very effective way to build a proof of concept, and are instrumental when the developers are trying to create the software stack. But, for a mass scale production a specific design is created. A specific design has benefits of power, thermal and performance. For example:</p> <ul> <li>Amazon has a custom board for Echo, with Texas Instrument <a href="http://www.ti.com/product/dm3725" rel="nofollow noreferrer">DM3725</a> at its core and other chips on the main board. This <a href="https://www.ifixit.com/Teardown/Amazon+Echo+Teardown/33953#s79333" rel="nofollow noreferrer">ifixit tear down</a> provides details of the board.</li> <li>Google Home devices are built with <a href="https://www.ifixit.com/Teardown/Google+Home+Teardown/72684#s145464" rel="nofollow noreferrer">Armada 1500 Mini Plus dual-core ARM Cortex-A7</a> at core, and the board is again custom made for Home; with a number of supporting chips on the main board.</li> <li>Apple's HomePod as well houses a custom board, with Apple A8 at it's core, and a <a href="https://www.ifixit.com/Teardown/HomePod+Teardown/103133#s192615" rel="nofollow noreferrer">custom board</a>.</li> <li>Philips Hue bulbs are also based on a <a href="https://www.anandtech.com/show/6805/philips-hue-automated-home-lighting-gets-colorful/3" rel="nofollow noreferrer">custom built board</a>. </li> </ul> <blockquote> <p>Can they be substituted by normal smartphones in, let's say, a business setting so as to communicate to POS/Internet-enabled sale system?</p> </blockquote> <p>Using a smartphone will be a overkill, as smartphones are built to be multipurpose. And re-purposing a smartphone would hurt the solution in following aspects:</p> <ul> <li>Price effectiveness: A smartphone will drive up the cost of Bill of Materials (BoM).</li> <li>Power: Smartphones are too power hungry for a small IoT solution.</li> </ul>
|raspberry-pi|android|android-things|
In IoT, Is it necessary to involve single-boards such as Raspberry Pi as the only communication devices?
2762
<p>Are single boards always necessary when implementing an IoT connection? Can they be substituted by normal smartphones in, let's say, a business setting so as to communicate to POS/Internet-enabled sale system?</p> <p>I'm not well oriented with Android Things. I just saw the option to include its support when creating a new application in Android Studio. Any and all helpful advice is welcome.</p>
2018-03-26T13:07:41.990
<p>This interface is perhaps not as well documented as it should be.</p> <p>As it turns out, the actual SPI data and clock pins (SCK, MOSI, and MISO) are not specified in the struct; instead they are <em>assumed</em> to be wired consistent with the hardware SPI engine.</p> <p>The arguments that are specified in the struct are limited to things which are configurable. That includes the slave select (NSS) and reset pins.</p> <p>To clarify two points of apparent confusion:</p> <ul> <li><p>rxtx: this is a transmit/receive mode control for the RF stage, not a data pin</p></li> <li><p>dio: this vector of 3 pins represents the first three of the five sx127x DIO pins, which provide mode-dependent discrete functions. Typically for LoRa purposes DIO0 and DIO1 are used, while DIO2 is useful in some FSK modes. If a pin is not available, set it to LMIC_UNUSED_PIN.</p></li> </ul> <p>For purposes of this library, packet buffer data is written and read over the SPI bus, rather than on discrete pins. It is possible to configure two of the DIO pins to be a data output and slicer clock, but that is not used here.</p> <p>Some of this information can be gleaned from the <a href="https://github.com/matthijskooijman/arduino-lmic/blob/master/README.md" rel="nofollow noreferrer">README.md</a> of the Arduino-LMIC library, but some of it is only clear in the code. Reading the Semtech data sheet is also useful.</p>
|arduino|lorawan|
HopeRf RFM98 and arduino-lmic library
2766
<p>For a Lora assay I am looking over the <a href="https://github.com/matthijskooijman/arduino-lmic" rel="nofollow noreferrer">arduino lmic</a> library furthermore I look over the pinout on RFM98 Lora Module:</p> <p><a href="https://i.stack.imgur.com/A8foZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A8foZ.jpg" alt="enter image description here"></a></p> <p>But I cannot figure out how I will configure the library in order to use the MOSI and MISO pins (as far as I understand the recieved information will pass as serial in MOSI pin and I will send data in MISO pin) I mean the library provides this configuration:</p> <pre><code>lmic_pinmap lmic_pins = { .nss = 6, .rxtx = LMIC_UNUSED_PIN, .rst = 5, .dio = {2, 3, 4}, }; </code></pre> <p>And I understand that <code>.rxtx</code> may be mapped on arduino's pins for data io into LOraWan network (using LoRa Modulation) but which goes first and which goes second?</p> <p>I guess that the configuration code will be:</p> <pre><code>.rxtx={^somepin^,^anotherpin^} </code></pre>
2018-03-27T11:42:22.707
<p><strong>Sensor Used:</strong> MH-Z19 CO² Sensor.<br> It is a common type, small size sensor, using non dispersive infrared (NDIR) principle to detect the existence of CO² in the air, with good selectivity, non-oxygen dependent and long life.<br></p> <p><strong>Output Modes:</strong> UART and PWM wave I personally find this useful and used the same in a project. Also you can take help of the following github <a href="https://github.com/TD-er/NodeMCU_PCB" rel="nofollow noreferrer">link</a> to setup with NodeMCU.</p> <p>Details of the sensor can be found <a href="http://www.winsen-sensor.com/d/files/PDF/Infrared%20Gas%20Sensor/NDIR%20CO2%20SENSOR/MH-Z19%20CO2%20Ver1.0.pdf" rel="nofollow noreferrer">in this user manual (PDF).</a></p>
|sensors|hardware|arduino|
What is the best sensor for the measurement of Carbon-dioxide?
2770
<p>I need to measure the amount of carbon-dioxide in parts per million (ppm) within a closed environment. Currently, I am using a MQ-135 gas sensor which has some sort of concentration on Carbon-dioxide. Unfortunately, that sensor does not provide accurate values.</p> <p>What gas sensor can I get to obtain precise data?</p> <p>The cost should not be more than USD 30. The MQ-135 has a very slight concentration on CO². The value it returns has a high fluctuation rate. Within the difference of seconds the value changes from 450 ppm to 700 ppm. I want a digital sensor that should give accurate data like Carbon Dioxide Meter PCE-WMM 50. </p>
2018-03-29T07:56:50.853
<blockquote> <p>Is there any research done in finding optimal bands that do not interfere with the systems and could present IoT in Aviation as a strong application?</p> </blockquote> <p>Wireless Avionics Intra-Communications (WAIC), a wireless communication system researched by <a href="http://waic.avsi.aero/" rel="nofollow noreferrer">AVSI</a> (Aerospace Vehicle Systems Institute) is being developed to replace complex cabling with wireless in avionics. As per available material, the frequency band 4200 - 4400 MHz is the allocated band for the WAIC system.</p> <p>Some key examples of Potential WAIC Safety Applications</p> <ul> <li>Smoke Detection </li> <li>Fuel Tank/Line </li> <li>Proximity Temperature </li> <li>EMI Incident Detection </li> <li>Humidity/Corrosion Detection </li> <li>Cabin Pressure</li> <li>Emergency Lighting</li> <li>Ice Detection </li> <li>Landing Gear (Position Feedback, Brake Temperature, Tire Pressure, Wheel Speed, Steering Feedback)</li> </ul>
|wireless|
Which Wireless Frequency Bands could be preferrable for IoT in Aviation?
2774
<p>This question comes in lieu because everytime you board a plane the crew announces that the <em>passengers turn their phones off or use flight mode</em>.</p> <p>The core reason for this is the wireless adapters in a typical smart phone might affect the <strong>Navigation and Other On-Board Systems</strong> situated in the Cockpit.</p> <p>It would be rather an exceptional challenge to find a wireless band which can be used in the field of <strong>Wireless Sensor Networks</strong>.</p> <p>Is there any research done in finding optimal bands that do not interfere with the systems and could present IoT in Aviation as a strong application?</p>
2018-03-30T08:50:06.083
<p>Great answers already, I'd just like to add a few other things that you should take into consideration. Like hardlib and Goufalite have already mentioned, the way to do this is trigonometrically. I've drawn out a 2-d depiction of the camera and the IoT object:</p> <p><a href="https://i.stack.imgur.com/xZjGb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xZjGb.png" alt="enter image description here"></a></p> <p>As you can see, the camera's field of view is going to be larger than the object - if not in close range, when the object moves further away.</p> <p>Now, you <em>may</em> want the camera always centred on the object. In that case, you can simply take the calculations that hardlib referenced:</p> <pre><code>ϴ = arctan(y/x) </code></pre> <p>...which will be the angle counterclockwise from the x-axis, per convention. You'll also need the angle away from level:</p> <pre><code>α = arctan(z / ((y^2+x^2)^1/2)) </code></pre> <p>Obviously, you'll have to calculate based off of the camera position being at the origin in all three axes.</p> <p><strong>On the other hand,</strong> you may prefer to not make the camera move more than necessary, that is, to make the camera only move once the object appears to be about to move out of the frame. In that case, you'll probably want a "pressure" variable which will make the camera more likely to change its angle based on how close the object is to the edge of the frame.</p> <p>If you go that route, you'll need to know the angle of the camera's field of view in both fields of view, so that you can determine where the object is compared to the camera's field of view.</p>
|tracking-devices|surveillance-cameras|
How can I programmatically tell a camera where to point?
2780
<p>I don't have a particular camera in mind right now, I'm just curious how this is done, programmatically/mathematically. </p> <p>I have a 3D space, a rectangle, with a camera up in one corner looking inwards.<br> I have a moving object in that rectangle that's transmitting (x, y, z) coordinates of its current position.<br> I want to take those coordinates and translate them into instructions telling the camera to point at that position.<br> How is this translation typically done? </p>
2018-03-31T17:02:05.920
<p>It appears that <a href="https://github.com/OpenIPC" rel="nofollow noreferrer">OpenIPC</a> firmware is exactly like OpenWrt for IP cameras.</p>
|smart-home|digital-cameras|open-source|
Is there any open source firmware or OS for IP camera like openwrt for routers
2793
<p>Is there any open source firmware or OS for IP cameras like <a href="https://openwrt.org/" rel="noreferrer">OpenWrt</a> for routers.</p> <p>I need an OS or a firmware for IP cameras in order to communicate with our cloud service easily. I have some experience with OpenWrt that's why I'm thinking in that way.</p> <p>My target is to get an HTTP call (minimum GET call ) from the IP camera. Is there any IP camera which are using opensource firmware? </p>
2018-04-03T16:42:45.060
<p>Light toggle:</p> <pre><code>&amp;\u0000\u0014\u0000\u0018\u0017\u0018\u00170-\u0018\u0017\u0018\u00170[\u0019\u0016\u0018\u0017H\u0000\r\u0005\u0000\u0000\u0000\u0000 </code></pre> <p>Fan toggle:</p> <pre><code>&amp;\u0000\u0014\u0000\u0018\u0016\u0019-1\u0016\u0018\u0017\u0018-1D\u0019-\u0018\u00170\u0000\r\u0005\u0000\u0000\u0000\u0000 </code></pre> <p>Captured with a <a href="https://www.ibroadlink.com/rmPro+/" rel="nofollow noreferrer">https://www.ibroadlink.com/rmPro+/</a> and <a href="https://github.com/momodalo/broadlinkjs" rel="nofollow noreferrer">https://github.com/momodalo/broadlinkjs</a></p> <p>Hope that helps, I've not yet found if there's a secret separate 'on' to 'off' switch, toggling really sucks when trying to connect up to home automation</p>
|communication|infrared|
What IR codes are emitted by Faber/AEG/Franke/Smeg... RC?
2797
<p>What infra-red codes are emitted by the depicted* <a href="http://www.smeguk.com/product/rckf/" rel="nofollow noreferrer">remote control</a> used by many hood manufactures (Faber/Mepamsa, AEG, Franke, Smeg, Airlux...)?</p> <p>Identifying the manufacturer of the remote control / IR chip could be enough. It could be listed in lirc, irdb... IR codes repositories (hood manufactures are not listed there).</p> <p><img src="https://www.smeguk.com/smeg_com/images/products/0/0/RCKF.jpg" alt="remote control"></p> <p>* I do not have the device, otherwise I would record the codes.</p> <p>The goal is that the Smart hob can inform the hub the frying has started, but I do not know the IR codes to start the hood. The RC is quite expensive, so I rather tried to ask first.</p>
2018-04-04T18:02:30.637
<p>Most modern RF standards/protocols offer or require secure pairing. The appropriate Alliances or Consortia behind the standards have taken the necessary steps in their own way: </p> <ul> <li><p>For <strong><a href="https://www.wi-fi.org/" rel="noreferrer">WiFi</a></strong> (WPA, etc), the password is the out-of-band piece. </p></li> <li><p><strong><a href="https://z-wavealliance.org/z-wave_plus_certification/" rel="noreferrer">Z-Wave and Z-Wave Plus</a></strong> also have an "install key" (e.g. printed on a sticker) that you need to pass to the IoT hub before the device can join. Much of the new security systems run on Z-Wave and the "really secure option" thing has been thought about.</p></li> <li><p><strong><a href="http://www.zigbee.org" rel="noreferrer">ZigBee Pro Home Automation</a></strong> has a secret join key (not so secret anymore) that is used only during the joining (if your device doesn't have an install key). This makes the network vulnerable only at the instance you join a new device to the network, and only if the attacker knows the [not-so] secret key. Note: ZigBee Alliance no longer certifies new devices of this type. See ZigBee 3.0.</p></li> <li><p><strong><a href="http://www.zigbee.org/zigbee-for-developers/zigbee-3-0/" rel="noreferrer">ZigBee 3.0</a></strong> requires an install key which again is an out-of-band code passed to the Hub (e.g. sticker, NFC).</p></li> <li><p><strong><a href="https://www.lora-alliance.org/" rel="noreferrer">LoRa</a></strong> Similar set up. Except, IIRC, with LoRa WAN you pass the key to the LoRa server, not the immediate gateway the device is attaching to.</p></li> </ul> <p>You can read further detail on respective websites. Different protocols use different words/Language this process and it can be confusing. The loosely equivalent terms are usually: Paring, Joining, Commissioning, and Provisioning.</p>
|security|protocols|wireless|
Secure pairing support in various RF standards
2803
<p>I would like to understand if secure pairing can be implemented in all (or none?) IoT RF standards. </p> <p>For example: BLE provides Out-of-band possibility, which seems like only really secure option to me. But I have hard time finding information on security of WiFi, Z-Wave, ZigBee, XBee, LoRa, Ingenu, TI15.4 and other protocols during pairing. </p> <p>Could you suggest some standards which support secure pairing <em>"out of the box"</em>? </p>
2018-04-06T07:32:20.110
<p>Retained messages will only be delivered once (per connection).</p> <p>And there can only be 1 retained message on a given topic at any one time.</p> <p>So just connect, start the loop and subscribe to the topics you are interested in. When the message is delivered check the retained flag on the messages. If the message is retained then you can publish a new message with a null payload and the retained bit set to clear that topic. There is no need to do anything strange with the network loop.</p>
|mqtt|mosquitto|paho|
How to process the MQTT queue once?
2810
<p>I am developing a helper app to clean the retained messages on my Mosquitto MQTT service. The problem I have is how to process the queue <strong>once</strong> with <a href="https://pypi.python.org/pypi/paho-mqtt/1.1" rel="nofollow noreferrer">Paho MQTT</a>.</p> <p>I know how to</p> <ul> <li>block the thread (<code>loop_forever()</code>)</li> <li>query the queue asynchronously (<code>loop_start()</code>/ <code>loop_stop()</code>)</li> </ul> <p>What I would like to do is to process the queue once and quit (and process each of the topics gathered this way, which are (most likely) retained messages)</p> <p><code>loop()</code> was the most promising:</p> <blockquote> <p>Call regularly to process network events. This call waits in select() until the network socket is available for reading or writing, if appropriate, then handles the incoming/outgoing data.</p> </blockquote> <p>Unfortunately I do not see any topics when using it.</p> <p>Right now my code starts a thread, waits 2 seconds and stops it. It does the job but I would like to understand how to do that cleanly though a one-pass processing:</p> <pre class="lang-python prettyprint-override"><code>import paho.mqtt.client as mqtt import time class MQTT: def __init__(self): print(&quot;initializing app&quot;) self.client = mqtt.Client() self.client.on_connect = self.on_connect self.client.on_message = self.on_message self.client.connect(&quot;mqtt.example.com&quot;, 1883, 60) self.client.loop_start() time.sleep(2) self.client.loop_stop() def on_connect(self, client, userdata, flags, rc): print(&quot;connected to MQTT with result code &quot; + str(rc)) self.client.subscribe(&quot;#&quot;) def on_message(self, client, userdata, msg): # EDIT: added a check for actually retained messages if msg.retain: print(f&quot;removing retained {msg.topic}&quot;) self.client.publish(msg.topic, retain=True) MQTT() </code></pre>
2018-04-07T11:33:20.533
<p>There is a great variety of omni 868Mhz antennae way under 20€ that can do the job. <a href="https://eu.mouser.com/Passive-Components/Antennas/_/N-8w0fa?P=1z0wn4u&amp;No=25" rel="nofollow noreferrer">https://eu.mouser.com/Passive-Components/Antennas/_/N-8w0fa?P=1z0wn4u&amp;No=25</a></p>
|lora|lorawan|
Using television Yagi antenna on a public homemade LoraWan gateway
2813
<p>I thought it would be nice to setup my own LoraWan public Gateway in order to extend "The Things Network" network. But in order to do that I think that I will need to use a proper antenna in order to achieve maximum range. </p> <p>So I thought that if I use a television antenna (<a href="https://en.wikipedia.org/wiki/Yagi%E2%80%93Uda_antenna" rel="nofollow noreferrer">Yagi Uda</a> or similar antennas) it would be an affordable way to achieve a decent range, but would I achieve that or I am saying nonsense?</p> <p>The proposed gateway location is at single storey building (~3m Altitude) at Acharnes, Greece. The possible obstacles will be taller buildings ~10m high. Also in direct sight the is a mountain as well but I do not care about this obstacle. I want to cover as much distance as possible with a budget for antenna less than 20 euros.</p>
2018-04-09T13:41:23.740
<p>As the library's documentation states the RFM9x's <code>NSS</code> pin should get connected into pin <code>10</code>. Also as you can see in the following image:</p> <p><img src="https://i.stack.imgur.com/QJx5X.jpg" alt="Arduino SPI Interface"> the pin 10 is the SPI's slave select pin (<code>ss</code> in short) so the <code>NSS</code> pin on the RFM9x is connected into slave select pin. </p> <p>So in the function:</p> <pre><code>LoRa.setPins(ss, reset, dio0); </code></pre> <p>The <code>ss</code> variable takes the number of pin that is conected to RFM9x's <code>NSS</code> pin.</p> <p>Furthermore it is obvious that the RFM9x's <code>NSS</code> pin is used for <strong>SPI</strong>'s <strong>slave select</strong>.</p>
|lora|arduino|
Using Arduino LoRa with RFM9X chipset: How to connect the RMF9x NSS pin?
2820
<p>As I am searching on libraries that can be used with Lora and arduino I came across on this one: <a href="https://github.com/sandeepmistry/arduino-LoRa" rel="nofollow noreferrer">https://github.com/sandeepmistry/arduino-LoRa</a></p> <p>Also the RFM9x has the following pinout: <a href="https://i.stack.imgur.com/A8foZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A8foZ.jpg" alt="RMF 9x Pinout"></a></p> <p>The data transfer on this chip is achieved via an SPI Interface. Also as I see with the librarie's API specification is that I can setup the pins Slave Select (ss), reset and dio0 with the function:</p> <pre><code>LoRa.setPins(ss, reset, dio0); </code></pre> <p>So I should configure the pins reset and dio0 like that:</p> <pre><code>Parameter Name -&gt; On RMF9x Chip pin reset -&gt; RESET dio0 -&gt; DIO0 </code></pre> <p>But I cannot figure out how to connect the <code>ss</code> pin mentioned in the method above, is the on-rmf9x chip the <strong><em>NSS</em></strong> pin?</p>
2018-04-10T09:34:46.797
<p>A more structured allocation might be better, because you are very tight for available time slots. I think you need to run some monte-carlo simulations of your proposed system too (and check that you can first replicate your current failure timescale).</p> <p>I'd suggest to incrementally slow-down any endpoint which is polling, but failing. Your steady-state should be within the available bandwidth, so the slowdown ought not to impact any/many active endpoints. If you do not back off, it only takes a couple of hundred endpoints to completely DOS your network.</p> <p>You might also need to better characterise the connections, and the start-up state (assuming endpoints are static, but the router got rebooted). When all 60 connections are in use, does the next transmission kick off one of these, block several established connections, or need to wait longer for a slot to be freed up? What is the minimum number of pathologically timed connections to block the system (with worst case overlap of the 2 minute slots)? These ought to be reasonable easy to model in software.</p>
|wifi|routers|
Avoid limited connections of WiFi Router
2823
<h2>Scenario</h2> <p>I developed a simple board that connects via WiFi and upload some data to a remote server. The network management is up to the customer but now he asks me some hints about how to avoid the limited number of connections allowed.</p> <h2>The issue</h2> <p>There are thousands of those boards around, but only few hundreds of them are within the range of the router (I only know is a Huawei router that allows 60 WiFi connections at time).</p> <p>Currently the firmware will try to connect every 20 minutes and, if the connection is granted, the time required to do all the stuff is about 1-2 minutes. After that the boards would upload another set of records after other 20 minutes but this time the connection will last for a fraction of second (because it has no data, just a "keep alive" signal to the server). </p> <p>Each board will remain in this area for few hours. That means during the whole day the mean quantities of boards in the "upload area" is quite constant.</p> <p>With this setup, often happens that a lot of units cannot upload data in their parking slot time, so the next time they have the double of data to be uploaded, and eventually the situation becomes worse.</p> <h2>Question</h2> <p>Of course the first thing is try to find another router that allows more connections, obviously.</p> <p>My question is related about any software pattern/strategy to improve the overall efficiency.</p> <p>My thoughts: all boards try to connects randomly. They are not tied to a specified hour. Hence we assume the probability at a given time is quite uniform. If the router can accept 60 connections at time, it means that the next one will be refused. <em>If</em> I can catch this error, I would retry more frequently than 20 minutes.</p> <p>In this way I should increase the probability to find a free 'slot' in the same amount of time spent there. Of course I wouldn't do that if I cannot know if the connection is refused for other reasons because it will drain the battery too fast.</p> <p>Any other ideas? Are there any router specifically designed for such an IoT application? And, as per your knowledge, the limitation is due to the radio bandwidth or the capability of the router to handle more connections internally?</p>
2018-04-12T14:50:30.573
<blockquote> <p>Do they support the version 1.0.x and not the latest 1.1 version?</p> </blockquote> <p>Indeed. </p> <p>Though I'm not sure of the status of the original LMiC library, the Arduino port you're referring to is based on LMiC 1.5 and indeed only supports LoRaWAN 1.0.x. It's not explicitly noted in <a href="https://github.com/matthijskooijman/arduino-lmic" rel="nofollow noreferrer">its README</a>, but looking at <a href="https://github.com/matthijskooijman/arduino-lmic/commits/master" rel="nofollow noreferrer">the changes</a> you'll see that the last meaningful commit dates back to August 2017, while LoRaWAN 1.1.x was not released until November that year.</p> <p>Beware that your LoRaWAN provider might not be supporting 1.1 either. (Like the public network of The Things Network only supports 1.0.x right now.)</p>
|lorawan|
Why does IBM's arduino-lmic example for abp activation have only 2 keys?
2832
<p>As far as I know the LoraWan v1.1 Spec uses the following keys:</p> <ul> <li><strong>FNwkSIntKey</strong>: In order secure the message integrity on the data that a node sends to the server.</li> <li><strong>SNwkSIntKey</strong>: In order to secure the message integrity on the data that a node receives from the network.</li> <li><strong>NwkSEncKey</strong>: In order to encrypt the payload data transfered over the network.</li> </ul> <p>Also I have seen that also supports the following keys when performs a join procedure:</p> <ul> <li><strong>JSIntKey</strong>: That is used for message integrity during join procedures.</li> <li><strong>JSEncKey</strong>: That is used for message encryption during join procedures.</li> </ul> <p>Also I have looked over a current abp activation <a href="https://github.com/matthijskooijman/arduino-lmic/blob/master/examples/ttn-abp/ttn-abp.ino" rel="nofollow noreferrer">code example</a> using IBM's lmic library.</p> <p>And I saw only the having a network session key and an Application session key according to the snippet:</p> <pre><code>static const PROGMEM u1_t NWKSKEY[16] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }; static const u1_t PROGMEM APPSKEY[16] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }; </code></pre> <p>And I wonder why they have only 2 session keys. So I want to ask:</p> <ul> <li>Do they support the version 1.0.x and not the latest 1.1 version? </li> <li>If they support the version 1.1 do they use only 2 keys for backwards compartibility (the documentation states that <strong>FNwkSIntKey</strong>, <strong>SNwkSIntKey</strong>, <strong>NwkSEncKey</strong> should have the same value in case of Backwards compartibility)?</li> <li>If yes how I will use it in order to support the full non-backwards compartible spec 1.1 of LoraWan?</li> </ul>
2018-04-13T12:48:42.570
<p>One thing that should be noted is that 5G will not just improve network performance from a single user perspective, but will also utilise bandwidth more efficiently; more devices will be served by a single base station.</p> <p>One enabling technology should be of particular interest to the IoT community: <a href="https://en.wikipedia.org/wiki/MIMO" rel="noreferrer">Massive MIMO</a>. Massive MIMO has the potential to be used for <a href="https://arxiv.org/pdf/1511.08689.pdf" rel="noreferrer">energy harvesting</a>. From the linked paper:</p> <blockquote> <p>To achieve this, the BSs can transmit dedicated RF signals on the DL and perform energy beamforming so as to provide uninterrupted wireless energy transfer (WET) to the UEs. Alternatively, the BSs can attempt simultaneous wireless information and power transfer (SWIPT), where the DL RF signals are used to simultaneously transport both energy and information to the UEs. MM is particularly suitable for such RF EH applications because the large array gains offered by MM can increase the energy transfer efficiency of RF signals</p> </blockquote> <p>To be clear, energy harvesting is <em>not</em> part of the 5G specification and I don't have any good information on the maturity of this technology. In 2016 I attended a presentation from Lund university where I understood that a proof of concept for massive MIMO energy harvesting was planned. I've not heard anything more following.</p> <p>If 5G is a step towards powering IoT devices wirelessly the that is pretty exciting, but event without that the increased device density it will offer is of serious interest.</p>
|protocols|data-transfer|
Why is 5G a plus for IoT?
2833
<p>I'd been hearing a lot about 5G recently from a few people I know, and one of the frequent claims that I heard was, "5G is going to be such a great help for the Internet of Things!"</p> <p>I may be a hopeless cynic, but I began to wonder, just why would this be the case? After all, the majority of IoT doesn't involve the transfer of huge amounts of data. Furthermore, it doesn't seem like an extra second or two of delay will make a lot of difference for your smart washing machine or even your lights. Hey, they already seem fast enough to me.</p> <p>So why would 5G be a plus for the Internet of Things?</p>
2018-04-19T07:50:48.263
<p>You are facing these build errors as you are missing the sysroot corresponding to the arm-gcc that you are using as your CC.</p> <p>You may try changing the Makefile as follows:</p> <pre><code>diff --git a/Makefile b/Makefile index 49cbb13..1123f27 100755 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ endif ifeq ($(OSTYPE),Linux) -CC ?= gcc +CC ?= /path/to/arm-linux-gnueabi/arm-linux-gnueabi-gcc-4.9.3 ifndef INSTALL INSTALL = install @@ -82,10 +82,10 @@ VERSION = ${MAJOR_VERSION}.${MINOR_VERSION} EMBED_MQTTLIB_C_TARGET = ${blddir}/lib${MQTT_EMBED_LIB_C}.so.${VERSION} -CCFLAGS_SO = -g -fPIC -Os -Wall -fvisibility=hidden -DLINUX_SO -FLAGS_EXE = -I ${srcdir} -L ${blddir} +CCFLAGS_SO = --sysroot=/path/to/sysroot -g -fPIC -Os -Wall -fvisibility=hidden -DLINUX_SO +FLAGS_EXE = --sysroot=/path/to/sysroot -I ${srcdir} -L ${blddir} -LDFLAGS_C = -shared -Wl,-soname,lib$(MQTT_EMBED_LIB_C).so.${MAJOR_VERSION} +LDFLAGS_C = --sysroot=/path/to/sysroot -shared -Wl,-soname,lib$(MQTT_EMBED_LIB_C).so.${MAJOR_VERSION} all: build @@ -168,8 +168,8 @@ VERSION = ${MAJOR_VERSION}.${MINOR_VERSION} EMBED_MQTTLIB_C_TARGET = ${blddir}/lib${MQTT_EMBED_LIB_C}.so.${VERSION} -CCFLAGS_SO = -g -fPIC -Os -Wall -fvisibility=hidden -Wno-deprecated-declarations -DUSE_NAMED_SEMAPHORES -FLAGS_EXE = -I ${srcdir} -L ${blddir} +CCFLAGS_SO = --sysroot=/path/to/sysroot -g -fPIC -Os -Wall -fvisibility=hidden -Wno-deprecated-declarations -DUSE_NAMED_SEM +FLAGS_EXE = --sysroot=/path/to/sysroot -I ${srcdir} -L ${blddir} LDFLAGS_C = -shared -Wl,-install_name,lib$(MQTT_EMBED_LIB_C).so.${MAJOR_VERSION} </code></pre> <p>You will need to change add the right <strong>sysroot path</strong> to <code>CCFLAGS_SO</code>, <code>FLAGS_EXE</code> and <code>LDFLAGS_C</code> variables in Makefile. I have only given examples.</p> <p>When I made these substitutions I was able to build paho.</p>
|mqtt|linux|paho|
How to cross compile Paho-MQTT-C library for ARM?
2856
<p>How to for cross compiling Paho-MQTT C library for ARM platform.</p> <p>Here are the steps I followed.</p> <pre><code>1) Downloaded library from [https://github.com/eclipse/paho.mqtt.embedded-c][here] 2) after download, I opened the directory and entered some commands. 3) command for setting the GCC-ARM tool chain (environment variable_path) 4) make CC=(ARM-CROSS_COMPILE)gcc </code></pre> <p>Next, I observe following error </p> <pre><code>mkdir -p build/output/samples mkdir -p build/output/test echo OSTYPE is Linux OSTYPE is Linux sed -e "s/@CLIENT_VERSION@/1.2.0/g" -e "s/@BUILD_TIMESTAMP@/Mon Apr 16 17:13:10 IST 2018/g" src/VersionInfo.h.in &gt; build/VersionInfo.h arm-cortexa9-linux-gnueabihf-gcc -g -fPIC -Os -Wall -fvisibility=hidden -Ibuild -o build/output/libpaho-mqtt3c.so.1.0 src/MQTTPersistence.c src/Heap.c src/Socket.c src/MQTTProtocolClient.c src/MQTTProtocolOut.c src/StackTrace.c src/MQTTPersistenceDefault.c src/MQTTClient.c src/Messages.c src/MQTTPacketOut.c src/Clients.c src/OsWrapper.c src/Thread.c src/MQTTPacket.c src/Log.c src/LinkedList.c src/utf-8.c src/SocketBuffer.c src/Tree.c -shared -Wl,-init,MQTTClient_init -lpthread -Wl,-soname,libpaho-mqtt3c.so.1 ln -s libpaho-mqtt3c.so.1.0 build/output/libpaho-mqtt3c.so.1 ln -s libpaho-mqtt3c.so.1 build/output/libpaho-mqtt3c.so arm-cortexa9-linux-gnueabihf-gcc -g -fPIC -Os -Wall -fvisibility=hidden -Ibuild -o build/output/libpaho-mqtt3cs.so.1.0 src/MQTTPersistence.c src/Heap.c src/Socket.c src/SSLSocket.c src/MQTTProtocolClient.c src/MQTTProtocolOut.c src/StackTrace.c src/MQTTPersistenceDefault.c src/MQTTClient.c src/Messages.c src/MQTTPacketOut.c src/Clients.c src/OsWrapper.c src/Thread.c src/MQTTPacket.c src/Log.c src/LinkedList.c src/utf-8.c src/SocketBuffer.c src/Tree.c -DOPENSSL -shared -Wl,--start-group -lpthread -ldl -lssl -lcrypto -Wl,--end-group -Wl,-init,MQTTClient_init -Wl,-soname,libpaho-mqtt3cs.so.1 -Wl,-no-whole-archive In file included from src/MQTTPersistence.h:23:0, from src/MQTTPersistence.c:28: src/Clients.h:29:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/Socket.c:32:0: src/SocketBuffer.h:28:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/SSLSocket.c:31:0: src/SocketBuffer.h:28:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/MQTTPacket.h:25:0, from src/MQTTProtocolClient.h:25, from src/MQTTProtocolClient.c:34: src/SSLSocket.h:29:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/MQTTPacket.h:25:0, from src/MQTTProtocolOut.h:24, from src/MQTTProtocolOut.c:35: src/SSLSocket.h:29:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/StackTrace.c:21:0: src/Clients.h:29:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/MQTTPersistence.h:23:0, from src/MQTTClient.c:53: src/Clients.h:29:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/MQTTPacket.h:25:0, from src/MQTTPacketOut.h:22, from src/MQTTPacketOut.c:29: src/SSLSocket.h:29:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/Clients.c:24:0: src/Clients.h:29:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/MQTTPacket.h:25:0, from src/MQTTPacket.c:26: src/SSLSocket.h:29:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/MQTTPacket.h:25:0, from src/Log.c:27: src/SSLSocket.h:29:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. In file included from src/SocketBuffer.c:25:0: src/SocketBuffer.h:28:25: fatal error: openssl/ssl.h: No such file or directory compilation terminated. Makefile:219: recipe for target 'build/output/libpaho-mqtt3cs.so.1.0' failed make: *** [build/output/libpaho-mqtt3cs.so.1.0] Error 1 </code></pre> <p>4) I installed openssl using this command</p> <blockquote> <p>$ sudo apt-get install libssl-dev*</p> </blockquote> <p>Openssl installed successfully, but still getting the same above error .</p> <p>What I have to do for compiling Paho-MQTT-C library for ARM?</p>
2018-04-23T04:31:18.727
<p>After a while of repetitively going through the code and my logic with no luck, I finally decided to probe the signals and check the timing of the 1-second silence preceding and succeeding the escape sequence. After checking the timing, it looked like the silence was less than 1-second, don't remember exactly how much. So I just changed the above code to the following and it started to work.</p> <pre class="lang-c prettyprint-override"><code>void TS_NinaDataModeToCommandMode(void){ _delay_ms(1050); UART_write('+'); UART_write('+'); UART_write('+'); _delay_ms(1050); } </code></pre> <p>I am going to further reduce the delay 1050 ms to lower and check what is the optimal value I can use since these are not accurate delays. I hope this helps!</p> <p>For more details please visit the forum discussion thread <a href="https://forum.u-blox.com/index.php/18748/commands-dont-work-after-switching-command-mode-from-data-mode" rel="nofollow noreferrer">here</a></p>
|bluetooth-low-energy|
Unable to receive response to AT commands after switching from data mode to command mode
2867
<p>I am having issues with receiving the response to the AT commands from the NINA after switching from data mode to back to command mode. I used the "ATS2?" command to check the escape character and received just a single 43(DEC) as a response which is basically '+' in ASCII. The section 2.5 of the "<a href="https://www.u-blox.com/sites/default/files/NINA-B1_GettingStarted_%28UBX-16009942%29.pdf" rel="nofollow noreferrer">NINA-B1 Getting Started</a>" manual states the following:</p> <p>"By default, NINA-B1 will enter command mode and has to be reconfigured to start up in data mode or extended data mode. From the data mode or extended data mode, it is possible to enter the command mode by transmitting escape sequence to the module. By default, the escape sequence is:</p> <pre><code>1. Silence 1 second 2. +++ 3. Silence 1 second" </code></pre> <p>Here is the <a href="https://www.u-blox.com/sites/default/files/u-blox-SHO_ATCommands_%28UBX-14044127%29.pdf" rel="nofollow noreferrer">NINA-B1 AT commands Manual</a></p> <p>I did the above in my program and also get an "OK", but for some reason after switching from the data mode to command mode, the NINA does not respond to the AT commands. Below is my code snippet for switching from Data Mode to Command Mode.</p> <pre class="lang-c prettyprint-override"><code>void TS_NinaDataModeToCommandMode(void){ _delay_ms(1000); UART_write('+'); UART_write('+'); UART_write('+'); _delay_ms(1000); } </code></pre> <p>Any insights would be helpful.</p>
2018-04-24T12:28:25.450
<blockquote> <p>How big is a <em>LoRa packet</em> including PHY headers</p> </blockquote> <p>I assume you mean MAC header? After some LoRa chip has demodulated the LoRa radio signals for you, it will give you the LoRa PHY payload. For a LoRaWAN uplink such PHY payload holds a MAC header, MAC payload and MIC.</p> <p>For 1.0.x the rule of thumb seems to be that a LoRaWAN packet is <a href="https://www.thethingsnetwork.org/forum/t/spreadsheet-for-lora-airtime-calculation/1190/4" rel="noreferrer">at least 13 bytes</a> larger than the application payload:</p> <blockquote> <p>I think usually at least 13 [ MHDR (1) + DevAddr (4) + FCtrl (1) + FCnt (2) + Fport(1) + MIC(4) ] in a packet with no options </p> </blockquote> <p>The maximum application payload depends on the selected data rate. If a node should be able to operate in worst conditions, then one should assume the worst data rate, SF12, where the node should not send more than about 51 bytes. (Where in best conditions, SF7, that might be 222 bytes.) All that also depends on the region, I think. (And things might be better when the LoRaWAN node does not use LoRa, but FSK.)</p> <p>So, for your use case, I'd try not to depend on some maximum length through USB. Instead:</p> <ul> <li><p>You can easily convert the binary LoRaWAN packet to plain text using <a href="https://en.wikipedia.org/wiki/Base64" rel="noreferrer">Base64</a>. You can then send such text through USB and terminate it with a newline or <a href="https://en.wikipedia.org/wiki/Null-terminated_string" rel="noreferrer">a <em>NULL</em>-character</a> to let your receiver know when the USB message is complete. You can even send additional meta data in that line of text if you choose a separator that is not in the Base64 character set.</p></li> <li><p>For example, <a href="https://github.com/Lora-net/packet_forwarder/blob/master/PROTOCOL.TXT" rel="noreferrer">the Semtech UDP protocol</a> between gateways and servers uses JSON text messages, which also allows you to pass additional meta data. In the JSON text, the binary LoRaWAN packet is also encoded using Base64. If the JSON text is pretty-formatted to include newlines, then you could still terminate such text message with a <em>NULL</em>-character and your receiver would not be confused.</p></li> </ul>
|lora|lorawan|
What is the maximum Packet Size of a LoraWan including the phy headers
2874
<p>I created a LoRa to USB pass-through via Arduino in order to use it as a temporary gateway for development purposes. So somehow I need to know how big a <em>LoRa packet</em> including PHY headers is, in order to determine how long it will take my software to read and send the data on top a USB.</p> <p>In order words my architecture will be as follows:</p> <p><a href="https://i.stack.imgur.com/sF4W6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sF4W6.png" alt="Architecture for LoraWan"></a></p> <p>So the PC/Laptop will need to "know" how big the <em>LoRa packet</em> will be in order not to receive via USB countless number of bytes.</p>
2018-04-30T05:40:06.303
<p>Adding to Simon's answer, the GDPR is more about processes than IT systems if you look at it in more detail. Sure, there are some technical things in there (mostly encryption and pseudonymization) but for the bigger part it dictates what you are allowed to do with data at all. Keep in mind for everything following, that I'm not a lawyer—just someone who's some experience making his stuff GDPR ready.</p> <hr /> <p><em><strong>TL;DR:</strong></em> Devices itself cannot be compliant or non-compliant on themselves. Cameras can be tricky though. Regarding your certification question, the answer seems to be <em>not yet</em>.</p> <hr /> <h2>Some general things about GDPR</h2> <p>First of all it defines a specific opt-in mechanism for customer's data. This means as data processing legal entity you'll need to keep a record of the customer giving that consent and that consent has to specify which data you'll use and what purposes you are using it for. See <a href="https://en.wikipedia.org/wiki/General_Data_Protection_Regulation#Lawful_basis_for_processing" rel="noreferrer">Wiki sections 2.4 &amp; 2.5</a>.</p> <p>Secondly it gives the user the <a href="https://gdpr-info.eu/art-15-gdpr/" rel="noreferrer">expressed right</a> to get all the data that the company has stored about him or her. That means every data in every system that can be tied to the specific user has to be provided. You can imagine that in bigger companies where all sorts of systems hold data that's somehow connected to a user that is kind of a hassle. I guess Netflix has some fun with that if you look at their systems:</p> <p><a href="https://i.stack.imgur.com/ObI7J.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/ObI7J.jpg" alt="Netflix Services" /></a> <a href="https://www.slideshare.net/BruceWong3/the-case-for-chaos" rel="noreferrer">Source (Slide 12)</a></p> <p>The following articles go on to give the right to <a href="https://gdpr-info.eu/art-16-gdpr/" rel="noreferrer">rectify</a> incorrect data and <a href="https://gdpr-info.eu/art-17-gdpr/" rel="noreferrer">erase</a> it completely—of course only if no other law requires you to keep the data (e.g. tax or auditing laws for bills).</p> <p>Of course, there are tons of pitfalls in the other forty-something articles of the first fifty that define your responsibilities and consumer rights that I haven't even mentioned. Like not being able to put the data anywhere where the EU standards aren't met—which if you read the thing seems to be everywhere, <a href="https://teachprivacy.com/us-congress-is-not-leader-privacy-security-law/" rel="noreferrer">certainly not the US</a>.</p> <h2>Camera considerations</h2> <p>Another interesting thing that might affect a device is <a href="https://gdpr-info.eu/art-32-gdpr/" rel="noreferrer">article 32—&quot;security of processing&quot;</a>—which is a bit fuzzy but if your camera is in front of a medical building it might be argued that you need end-to-end encryption with encryption of all data at rest on the camera too.</p> <blockquote> <p>Taking into account the state of the art, the costs of implementation and the nature, scope, context and purposes of processing as well as the risk of varying likelihood and severity for the rights and freedoms of natural persons, the controller and the processor shall implement appropriate technical and organisational measures to ensure a level of security appropriate to the risk, including inter alia as appropriate:</p> <p>(a) the pseudonymisation and encryption of personal data;</p> <p>(b) the ability to ensure the ongoing confidentiality, integrity, availability and resilience of processing systems and services;</p> <p>(c) the ability to restore the availability and access to personal data in a timely manner in the event of a physical or technical incident;</p> <p>(d) a process for regularly testing, assessing and evaluating the effectiveness of technical and organisational measures for ensuring the security of the processing.</p> </blockquote> <p><em>Since after EU law the picture of a person is (thankfully) considered personal data you are likely required to either pseudonymize or encrypt the pictures or video.</em></p> <h2>On Certifications</h2> <p>I haven't been able to find any that are based on the regulation itself. There's of course a bunch of people who sell you GDPR-sounding <em>&quot;certifications&quot;</em> but none (that I could find) seem to fulfill the requirements of the regulation as of today.</p>
|security|surveillance-cameras|
Are there any surveillance cameras/devices that are EU General Data Protection Regulation (GDPR) compliant?
2884
<p>I recently came across the <a href="https://www.eugdpr.org/eugdpr.org.html" rel="noreferrer">EU General Data Protection Regulation (GDPR)</a> meant for data privacy regulation. The <a href="http://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=CELEX:32016R0679&amp;qid=1490179745294&amp;from=en" rel="noreferrer">final Version of GDPR</a> was released December/2015. </p> <p>Any surveillance camera or devices that are known to be fully GDPR compliant? Are there compliance/certification programs that have been derived out of the EUGDPR guideline?</p> <p>I am not able to understand how the EU may be planning to ensure/enforce GDPR is being taken for the devices being sold?</p>
2018-04-30T21:57:54.890
<p>This loop looks suspicious, try removing the semicolon on first line:</p> <pre><code>while (PIR1bits.CCP1IF == 0); { if (PIR1bits.TMR1IF == 1) { PIR1bits.TMR1IF = 0; TMR1L = 0; TMR1H = 0; count = count+1; T1CONbits.TMR1ON = 1; } } </code></pre> <p>Overall, I suggest not to clear the timer counter. You could possibly miss some interrupts. Overflow happens after roll over, so the value would be already reset. See <a href="http://ww1.microchip.com/downloads/en/devicedoc/39631a.pdf" rel="nofollow noreferrer">Datasheet</a> on page 130 it says: </p> <blockquote> <p>The TMR1 register pair (TMR1H:TMR1L) increments from 0000h to FFFFh and rolls over to 0000h. The Timer1 interrupt, if enabled, is generated on overflow, which is latched in interrupt flag bit, TMR1IF (PIR1&lt;0>). This interrupt can be enabled or disabled by setting or clearing the Timer1 Interrupt Enable bit, TMR1IE (PIE1&lt;0>).</p> </blockquote>
|microcontrollers|pic|
Finding the time interval between two events using CCP on PIC18f4520
2888
<p>I'm trying to calculate the time elapsed between two events using the <code>CCP</code> on <strong>PIC18F4520</strong>. The events are triggered by two sensors that are on the <code>ccp1</code> and <code>ccp2</code> ports. I've assigned a prescalar of 8 to the <code>T1CON</code> and I'm using a crystal of 16 MHz. (Duration of one clock cycle is 2e-6 s) Since the maximum time I can measure before overflowing is just 0.13 seconds (65536 x 2e-6) and the event I'm measuring lasts for around 0.32 seconds I decided to count the number of times <code>TMR1IF</code> overflows and then multiply this by 65536 and add this to the captured <code>CCPR1H:CCPR1L</code> value.</p> <p>However, I'm unable to count beyond one overflow of the <code>TMR1IF</code> register.</p> <p>Hope someone knows why!</p> <p>Below are the associated functions</p> <pre><code>void ccp_Init(void) { TRISCbits.RC2 = 1; TRISCbits.RC1 = 1; CCP1CON = 0x05; CCP2CON = 0x05; T3CON = 0x00; PIE1bits.CCP1IE=1; PIE2bits.CCP2IE=1; T1CON = 0x30; TMR1H = 0; TMR1L = 0; PIR1bits.CCP1IF = 0; PIR2bits.CCP2IF = 0; PIR1bits.TMR1IF = 0; } int ccp_get(void) { int count = 0; TMR1L = 0; TMR1H = 0; while(PIR2bits.CCP2IF == 0); T1CONbits.TMR1ON = 1; while (PIR1bits.CCP1IF == 0); { if (PIR1bits.TMR1IF == 1) { PIR1bits.TMR1IF = 0; TMR1L = 0; TMR1H = 0; count = count+1; T1CONbits.TMR1ON = 1; } } T1CONbits.TMR1ON = 0; return count; } </code></pre> <p>From the above code <code>int ccp_get()</code> returns the number of times TMR1IF has overflowed and which isn't going beyond 1.</p>
2018-05-01T12:05:27.010
<p>One possible option is to use HTTPS and ship a real certificate on the device:</p> <p>Since you control the access point you presumably control the DHCP server on the access point, so you can have it provide a DNS server address at the same time.</p> <p>This DNS server can be on the AP and can resolve a fully qualified hostname to point to it's self.</p> <p>You can then purchase a certificate for that fully qualified domain name and bundle this with the product to create a fully verified HTTPS connection.</p> <p>One big problem with this idea is that you are shipping the private key and cert for that domain name, so you should assume it will be compromised at some point so you should never put a real machine (You may need to run a machine with this name for a very short time to actually get the certificate) on the internet that uses that host name as attackers would be able to easily spoof it. </p> <p>Also the firmware for the AP would have a limited life as the certificate will expires (probably after a year by default iirc) then you would get nasty certificate expired warnings.</p> <p><strong>Next Idea:</strong></p> <p>Ditch WiFi Access Point mode and use Bluetooth e.g.</p> <p><a href="https://www.hardill.me.uk/wordpress/2016/09/13/provisioning-wifi-iot-devices/" rel="nofollow noreferrer">https://www.hardill.me.uk/wordpress/2016/09/13/provisioning-wifi-iot-devices/</a></p> <p>Downside is that Apple doesn't currently support WebBluetooth, but Chrome on Windows/Linux/Mac does and you could ship a native iOS app for Apple phone/tablet users.</p>
|https|tls|
How would I use HTTPS on the web-based device config running an access point and no internet access?
2889
<p>I'm building a Raspberry Pi-based device for backyard gardeners that has a web page and access point for the initial configuration, including the Wi-Fi configuration. The connection uses WPA2 and the only two devices on that internal network would be the device itself and the user's phone/tablet/laptop. The access point is only visible during configuration which reduces the likelihood of outside attackers being able to guess the random, factory-shipped password. So I have encrypted traffic, almost certainly only two nodes, for a short time, and a random password. Thus there is no need for HTTPS that I can see, and I had planned to run HTTP.</p> <p>However, today I learned that starting in July Chrome will begin marking all HTTP sites as insecure.[1] But because the Wi-Fi configuration will be done by access point, no internet access is available yet to verify TLS certificates, which I understand is necessary for proper operation.[2] I could self-sign the cert, but that presents other problems.[3]</p> <p>So my options seem to be:</p> <ul> <li>Present the configuration page with a big, scary, "This website is not secure" message</li> <li>Present the configuration page with a big, scary, "This certificate is not trusted" message (e.g. self-signed)</li> </ul> <p>How would you provide that lovely green lock by default for a device configuration page?</p> <p>[1] <a href="https://www.theverge.com/2018/2/8/16991254/chrome-not-secure-marked-http-encryption-ssl" rel="noreferrer">https://www.theverge.com/2018/2/8/16991254/chrome-not-secure-marked-http-encryption-ssl</a></p> <p>[2] <a href="https://security.stackexchange.com/questions/56389/ssl-certificate-framework-101-how-does-the-browser-actually-verify-the-validity?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa">https://security.stackexchange.com/questions/56389/ssl-certificate-framework-101-how-does-the-browser-actually-verify-the-validity?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa</a></p> <p>[3] <a href="https://www.globalsign.com/en/ssl-information-center/dangers-self-signed-certificates/" rel="noreferrer">https://www.globalsign.com/en/ssl-information-center/dangers-self-signed-certificates/</a></p>
2018-05-02T09:38:13.870
<p>I loved this question when I read it. "It takes me back", as the greybeards say :) TinyOS "went public" in 2000 - about a year after the phrase "Internet of Things" was coined, <a href="https://en.wikipedia.org/wiki/Internet_of_things" rel="nofollow noreferrer">according to Wikipedia.</a> <em>A long time ago, in a galaxy far, far away...</em> OK, down to business: </p> <p>I believe the answer to your question as to whether or not motes, TinyOS, NesC, etc are "good options nowadays", is an unqualified <strong>"Yes"</strong>. I'll explain why.</p> <p>I learned of TinyOS in 2003; it was already a fairly mature system by then, and being used in some interesting applications. <strong>"Motes"</strong> is a term for the hardware, as in "remote sensor". Each mote had a processor, a battery, a radio (<strong>not</strong> WiFi) and some sort of a sensor. The first three components were common across a variety of motes, whereas the sensor was generally peculiar to the application; light, heat, magnetic fields, etc. If you're interested in details, numerous papers (mostly academic and wordy) have been published that document the design of TinyOS... <a href="https://people.eecs.berkeley.edu/~culler/papers/ai-tinyos.pdf" rel="nofollow noreferrer">here's one I like.</a></p> <p>As a system, TinyOS and the mote were designed to accomplish an objective with extremely scant resources. For example: </p> <ul> <li>TinyOS occupied about 400 bytes of memory; a typical application 12-16 kB. </li> <li>TinyOS runs on minuscule 8-bit micrcontrollers; e.g. Atmel's AT-90L, TI's MSP430 and <a href="https://www.microchip.com/wwwproducts/en/ATtiny9" rel="nofollow noreferrer">the more modern ATtiny9 from Microchip</a>. </li> <li>NesC code is more like part of the 'kernel' than a traditional application; system efficiency demanded this approach. </li> <li>Low duty cycles, and a system architecture that catered to energy conservation allowed batteries to last for a year or more (application dependent of course).</li> </ul> <p>Delivery of sensor data to its ultimate destination from broadly-dispersed motes that might be dropped from an aircraft, free-fall style, into an extremely hostile operating environment demanded clever routing algorithms. "Flexibility" was thus the key driver in design of TinyOS' communication stack. Consequently, no existing communication infrastructure is needed. This is of course both empowering and challenging. A number of routing protocols were developed, and the open-source licensing encouraged adoption and modification of these protocols. </p> <p>As far as TinyOS being abandoned, or stagnant, I don't feel that's the case. The <a href="https://github.com/tinyos" rel="nofollow noreferrer">TinyOS GitHub repo</a> shows recent activity, and suggests that it's <a href="https://github.com/tinyos/tinyos-main" rel="nofollow noreferrer">being maintained and cared after</a>. That said, TinyOS was never going to attract the "electronics-and-software-as-a-hobby" crowd; a crowd that didn't really exist until recently when Arduino and Raspberry Pi became popular.</p> <p>And that brings me to the point in this elaborate "answer" to your thought-provoking question. I don't think there is a cut-and-dried, matter-of-fact answer. I think <em>the</em> answer comes down to this: We humans are <a href="http://www.sheep101.info/201/behavior.html" rel="nofollow noreferrer">more like sheep</a> or <a href="http://intellectual-thoughts.com/Lemming%20Effect%20by%20Dr.%20Pastore.htm" rel="nofollow noreferrer">lemmings</a> than we like to believe. Raspberry Pi, Arduino, etc. are products that have attracted large followings of the curious and revenue for those who traffic in gadgets, but that has little or nothing to do with their suitability for a particular application. I'm <strong>not</strong> suggesting that one re-invent the wheel for each new problem, but at the same time, one (or two) size(s) do not fit all. Use the right tool for the job. </p> <p>I know from your question that you understand this, but perhaps haven't thought of it in this way. Frankly, neither had I until your question jarred some loose rocks. So yes, I think you can still build some very elegant things with TinyOS, but you may have to do it with fewer support resources. Or, maybe there will be a "TinyOS Stack Exchange" in the future? Ha ha - don't hold your breath :) </p> <p>I'll close with this: <a href="https://www.starwars.com/news/8-great-obi-wan-kenobi-quotes" rel="nofollow noreferrer">“The truth is often what we make of it; you heard what you wanted to hear, believed what you wanted to believe.”</a> </p> <h3>Addendum:</h3> <p>As you think about how to build your devices, and aggregate them into systems, <a href="https://www.youtube.com/watch?v=kadzyrJQ6YY" rel="nofollow noreferrer">Phil Levis offers some food for thought in this brief video.</a> </p> <p>And as far as resources to support TinyOS development, here are a few that I found while researching my "answer" here: </p> <ul> <li><a href="http://tinyos.stanford.edu/tinyos-wiki/index.php/TinyOS_Tutorials" rel="nofollow noreferrer">TinyOS tutorials</a> </li> <li><a href="http://tinyos.stanford.edu/tinyos-wiki/index.php/Main_Page" rel="nofollow noreferrer">TinyOS Documentation Wiki</a> </li> <li><a href="http://tinyos.stanford.edu/tinyos-wiki/index.php/FAQ" rel="nofollow noreferrer">TinyOS FAQ</a> </li> <li><a href="http://tinyos.stanford.edu/tinyos-wiki/index.php/Installing_TinyOS" rel="nofollow noreferrer">Installing TinyOS</a> </li> <li><a href="http://www.cse.wustl.edu/~lu/cse467s/slides/tinyos-installation.pdf" rel="nofollow noreferrer">Installing a TinyOS Development Environment as a Virtual Machine</a> </li> <li><a href="http://tinyos.stanford.edu/tinyos-wiki/index.php/Installing_XubunTOS_%28with_TinyOS_from_tp-freeforall/prod_repository%29_in_VirtualBox" rel="nofollow noreferrer">TinyOS VM, Windows, Linux, VirtualBox</a> </li> <li><a href="https://www.ida.liu.se/labs/rtslab/courses/wsn/tosInstallation.pdf" rel="nofollow noreferrer">TinyOS VM for Windows &amp; VMware users</a> </li> <li><a href="https://github.com/wedi/tinyos-virtual-machine" rel="nofollow noreferrer">TinyOS VM via GitHub</a> </li> <li><a href="https://fossil.twicetwo.com/csci256.pl/wiki?name=TinyOS+VM+image" rel="nofollow noreferrer">Yet another TinyOS VM approach</a> </li> </ul>
|sensors|hardware|microcontrollers|wireless|
What is difference between a mote and a microcontroller equipped with sensors and connectivity?
2892
<p>Reading some papers about IoT and Wireless Sensor Networks (WSN) I came across mote devices and have seen there are <a href="https://en.wikipedia.org/wiki/List_of_wireless_sensor_nodes" rel="nofollow noreferrer">lots of them</a>.</p> <p>I have understood that they are the leaves in an IoT system and that they are embedded devices equipped with sensors and optimized connectivity architecture but it is not clear to me what they are.</p> <p>For example is the difference between a mote device and a micro controller such as Arduino Uno only that a mote device is already equipped with sensors and for connectivity? </p> <p>Plus I have seen many of them support their own operating system such as TinyOS but looking at its wiki page it is not updated since 2012: are mote devices still a good option nowadays? The fact that many of them are programmed in their own programming languages (such as NesC for TinyOS) and not in C/C++ does not lead to interface problems with other devices?</p>
2018-05-04T05:31:19.743
<p>After a while of debugging and going through the code, I got to know that the problem was happening due to the Audio beeps on detection/reading a new card within the <em>void TestNFC_ReadTag (void)</em> function which was causing some intermediate delay between the time the UUID was read and the subsequent call to the read/write page API. <em><strong>So to write to or read from the NTAGs user memory, it is always necessary to issue the INDATAEXCHANGE command and invoke the read/write page immediately after the tag is read</strong></em>. So, I made some slight changes to the <em>void TestNFC_ReadTag (void)</em> function to meet this requirement and it works. The below is the changes I made:</p> <pre class="lang-c prettyprint-override"><code>/* Made these as static global variables */ uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; // Buffer to store the returned UID uint8_t uidLength; // Length of the UID (4 or 7 bytes depending on ISO14443A card type) // Reads cards, beep and long light flash for good card read, short light flash for no card read, lights mostly on for NFC chip not talking right void TestNFC_ReadTag (void) { bool success; static flag = 0; /************************************ Everytime Try Reading a Card ***********************************/ // Check for a good card read success = PN532_readPassiveTargetID(PN532_MIFARE_ISO14443A, &amp;uid[0], &amp;uidLength, 1000); if (success) { if(flag == 0){ testPN532WritePage(); flag = 1; } else{ testPN532ReadPage(); flag = 0; } LIGHT_ON(); EventTimerCreate(200,1,TestingLightsOff); for (int nfcBeep = 0; nfcBeep &lt; 300; nfcBeep++) { DACB.CH0DATA = 0x700; _delay_us(200); DACB.CH0DATA = 0x900; _delay_us(200); } DACB.CH0DATA = 0x800; _delay_ms(500); // Reduced from 1000ms to 500ms to avoid WDT reset - Vinay } // If Invalid card read then short light flash no beep else { LIGHT_ON(); _delay_ms(10); LIGHT_OFF(); } } void TestNFCInterrupt_ReadTag (void){ /* Read the tag and write/read to NTAG213 user memory */ TestNFC_ReadTag(); /* Needs to restart the scan to detect the NTAG passively */ PN532_StartScan(); } </code></pre> <p>I hope this helps!</p>
|nfc|
Unable to read the memory from NTAG213 via PN532
2897
<p>I am currently trying to write a few bytes from the PN532 to NTAG213's user-programmable memory and read back those bytes as well. The write and read happens when the PN532 detects the NTAG213 within proximity. I have ported the necessary functions from the Adafruits library <a href="https://github.com/adafruit/Adafruit-PN532" rel="nofollow noreferrer">here</a> for the ATxmega32A4U. To scan and read an NTAG213 card, I am using the below functions.</p> <pre class="lang-c prettyprint-override"><code>// Reads cards, beep and long light flash for good card read, short light flash for no card read, lights mostly on for NFC chip not talking right void TestNFC_ReadTag (void) { bool success; uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 }; // Buffer to store the returned UID uint8_t uidLength; // Length of the UID (4 or 7 bytes depending on ISO14443A card type) /************************************ Everytime Try Reading a Card ***********************************/ // Check for a good card read success = PN532_readPassiveTargetID(PN532_MIFARE_ISO14443A, &amp;uid[0], &amp;uidLength, 1000); // If card read is good then beep and long flash of main lights if (success) { LIGHT_ON(); EventTimerCreate(200,1,TestingLightsOff); for (int nfcBeep = 0; nfcBeep &lt; 300; nfcBeep++) { DACB.CH0DATA = 0x700; _delay_us(200); DACB.CH0DATA = 0x900; _delay_us(200); } DACB.CH0DATA = 0x800; _delay_ms(500); // Reduced from 1000ms to 500ms to avoid WDT reset - Vinay } // If valid card read then short light flash no beep else { LIGHT_ON(); _delay_ms(10); LIGHT_OFF(); } } /**************************************************************************/ /*! Waits for an ISO14443A target to enter the field @param cardBaudRate Baud rate of the card @param uid Pointer to the array that will be populated with the card's UID (up to 7 bytes) @param uidLength Pointer to the variable that will hold the length of the card's UID. @returns 1 if everything executed properly, 0 for an error */ /**************************************************************************/ bool PN532_readPassiveTargetID(uint8_t cardbaudrate, uint8_t *uid, uint8_t *uidLength, uint16_t timeout) { // read data packet if (PN532_readResponse(pn532_packetbuffer, sizeof(pn532_packetbuffer), timeout) &lt; 0) { return 0x0; } // check some basic stuff /* ISO14443A card response should be in the following format: byte Description ------------- ------------------------------------------ b0 Tags Found b1 Tag Number (only one used in this example) b2..3 SENS_RES b4 SEL_RES b5 NFCID Length b6..NFCIDLen NFCID */ if (pn532_packetbuffer[0] != 1) return 0; uint16_t sens_res = pn532_packetbuffer[2]; sens_res &lt;&lt;= 8; sens_res |= pn532_packetbuffer[3]; DMSG(&quot;ATQA: 0x&quot;); DMSG_HEX(sens_res); DMSG(&quot;SAK: 0x&quot;); DMSG_HEX(pn532_packetbuffer[4]); DMSG(&quot;\r\n&quot;); /* Card appears to be Mifare Classic */ *uidLength = pn532_packetbuffer[5]; for (uint8_t i = 0; i &lt; pn532_packetbuffer[5]; i++) { uid[i] = pn532_packetbuffer[6 + i]; } return 1; } /**************************************************************************/ /*! @brief Starts the scan @returns 1 if everything executed properly, 0 for an error */ /**************************************************************************/ uint8_t PN532_StartScan(void) { uint8_t pn532_packetbuffer[2]; uint8_t ret = 0; pn532_packetbuffer[0] = PN532_COMMAND_INLISTPASSIVETARGET; pn532_packetbuffer[1] = 1; pn532_packetbuffer[2] = PN532_MIFARE_ISO14443A; /* Disable the interrupt */ PORTA.INT1MASK &amp;= ~(1&lt;&lt;PIN7_bp); /* Send scan command and read acknowledgments */ if (PN532_writeCommand(pn532_packetbuffer, 3, NULL, 0)) ret = 0x0; // command failed else ret = 0x01; /* Enable the interrupt */ PORTA.INT1MASK |= PIN7_bm; return(ret); } </code></pre> <p>To write to and read from the NTAG213's memory. I use the below functions.</p> <pre class="lang-c prettyprint-override"><code>/**************************************************************************/ /*! Tries to write an entire 4-bytes data buffer at the specified page address. @param page The page number to write into. (0x04..0x27). @param buffer The byte array that contains the data to write. @returns 1 if everything executed properly, 0 for an error */ /**************************************************************************/ uint8_t PN532_writePage (uint8_t page, uint8_t *buffer) { if ((page &lt; NTAG_PAGE_START_ADDRESS) || (page &gt; NTAG_PAGE_END_ADDRESS)) { DMSG(&quot;Page value out of range\n&quot;); return 0; } /* Prepare the first command */ pn532_packetbuffer[0] = PN532_COMMAND_INDATAEXCHANGE; /* Card number */ pn532_packetbuffer[1] = 1; pn532_packetbuffer[2] = NTAG_CMD_WRITE_USER_EEPROM; /* NTAG213 Write cmd = 0xA2 */ pn532_packetbuffer[3] = page; /* page Number (0x04..0x27) */ memcpy (pn532_packetbuffer + 4, buffer, 4); /* Data Payload */ /* Send command to write to NTAG 213 EEPROM */ if (PN532_writeCommand(pn532_packetbuffer, 8, NULL, 0)) return 0; /* Read the response packet */ if(PN532_readResponse(pn532_packetbuffer, sizeof(pn532_packetbuffer), 100) &lt; 0) return 0; return 1; } /**************************************************************************/ /*! Tries to read an entire 4-bytes page at the specified address. @param page The page number ((0x04..0x27 in most cases) @param buffer Pointer to the byte array that will hold the retrieved data (if any) */ /**************************************************************************/ uint8_t PN532_readPage (uint8_t page, uint8_t *buffer) { if ((page &lt; NTAG_PAGE_START_ADDRESS) || (page &gt; NTAG_PAGE_END_ADDRESS)) { DMSG(&quot;Page value out of range\n&quot;); return 0; } /* Prepare the command */ pn532_packetbuffer[0] = PN532_COMMAND_INDATAEXCHANGE; pn532_packetbuffer[1] = 1; /* Card number */ pn532_packetbuffer[2] = NTAG_CMD_READ_USER_EEPROM; /* NTAG Read command = 0x30 */ pn532_packetbuffer[3] = page; /* page Number (0x04..0x27) */ /* Send the command */ if (PN532_writeCommand(pn532_packetbuffer, 4, NULL, 0)) return 0; /* Read the response packet */ //if(PN532_readResponse(pn532_packetbuffer, sizeof(pn532_packetbuffer), 100)) if(PN532_readResponse(pn532_packetbuffer, 20, 100) &lt; 0) return 0; #ifdef PN532_PGREAD_DBG printf(&quot;0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\r\n&quot;, pn532_packetbuffer[0], pn532_packetbuffer[1], pn532_packetbuffer[2], pn532_packetbuffer[3], pn532_packetbuffer[4], pn532_packetbuffer[5], pn532_packetbuffer[6], pn532_packetbuffer[7], pn532_packetbuffer[8], pn532_packetbuffer[9], pn532_packetbuffer[10], pn532_packetbuffer[11], pn532_packetbuffer[12], pn532_packetbuffer[13], pn532_packetbuffer[14], pn532_packetbuffer[15], pn532_packetbuffer[16], pn532_packetbuffer[17], pn532_packetbuffer[18]); #endif /* If the status isn't 0x00 we probably have an error */ if (pn532_packetbuffer[0] == 0x00) { /* Copy the 4 data bytes to the output buffer */ /* Block content starts at byte 1 of a valid response */ /* Note that the command actually reads 16 bytes or 4 */ /* pages at a time ... we simply discard the last 12 */ /* bytes */ memcpy (buffer, pn532_packetbuffer + 1, 4); } else { return 0; } // Return OK signal return 1; } </code></pre> <p>I was performing some tests and came across some issues when tried to read from the NTAG.</p> <p>The below test code works meaning: The PN532 is able to read the card as well as write and read back the user data from the NTAG.</p> <pre class="lang-c prettyprint-override"><code> void TestNFCInterrupt_ReadTag (void){ static uint8_t flag = 0; /* Test code. Always perform read or write prior to getting the uuid */ if(flag == 0){ testPN532WritePage(); flag = 1; } else{ testPN532ReadPage(); flag = 0; } /* Needs to restart the scan to detect the NTAG passively */ PN532_StartScan(); TestNFC_ReadTag(); PN532_StartScan(); } </code></pre> <p>But surprisingly, for the below code, the card is detected, the write works, but when next the read happens after the card is detected, I get a status error response as 0x27 which indicates that the command is not acceptable due to the current context of the PN532, this can be seen on page 68 of the <a href="https://www.nxp.com/docs/en/user-guide/141520.pdf" rel="nofollow noreferrer">PN532 user manual</a>.</p> <pre class="lang-c prettyprint-override"><code>void TestNFCInterrupt_ReadTag (void){ static uint8_t flag = 0; TestNFC_ReadTag(); /* Test code. Always perform read or write prior to getting the uuid */ if(flag == 0){ testPN532WritePage(); flag = 1; } else{ testPN532ReadPage(); flag = 0; } /* Needs to restart the scan to detect the NTAG passively */ PN532_StartScan(); } </code></pre> <p>Also, <a href="https://www.nxp.com/docs/en/data-sheet/NTAG213_215_216.pdf" rel="nofollow noreferrer">here</a> is the NTAG213 manual. Apologies for the exhaustive post, but taught the above information is necessary to seek help. I'd appreciate if anyone could take some time to check the code or suggest anything.</p>
2018-05-07T09:33:21.350
<p>I know it's pretty old thread, but still.. Have you heard about:</p> <p><a href="http://zboss.dsr-wireless.com/" rel="nofollow noreferrer">http://zboss.dsr-wireless.com/</a></p> <p>or</p> <p><a href="http://www.ti.com/tool/Z-STACK" rel="nofollow noreferrer">http://www.ti.com/tool/Z-STACK</a></p> <p>So.. it is possible to get the stack for free and to get cheap HW, e.g. CC2531.. Only problem I can see is that it is not that easy to compile (IAR license necessary) and even more complicated to grasp the whole zigbee specification and concept to be able to implement own device..</p>
|hardware|wireless|zigbee|
Why are Zigbee hardware modules so expensive?
2906
<p>The Zigbee hardware looks quite simple to produce<sup><sup><sub>1</sub></sup></sup>, why are they so expensive? </p> <p>For comparison I can get a 855 Mhz wireless module for 2-3€ but I can't find Zigbee modules under 15€.</p> <p>[1]<img src="https://www.buyapi.ca/wp-content/uploads/2017/10/xbee-s2c-zigbee.jpg" alt="Xbee modules"></p>
2018-05-10T02:03:37.653
<p>Having been to many a trade show, there are a few things to set when on the expo floor:</p> <ol> <li>Hide the AP name. Most devices won't try and connect if they can't see the AP name.</li> <li>Look for a channel that is least used and set the AP to use it.</li> <li>connect all you can via wired Ethernet to minimize the number of WiFi nodes trying to connect to the AP. We had the same issues you had at an Intel show, until we hard-wired the MQTT Broker to the AP...then things worked great.</li> <li>turn down the transmit power...if all they are connecting to is in your booth, then cut the Transmit power by half....if you have an AP that can do that. I always bring along a DD-WRT AP node that has the ability to inspect channels and modify transmit power.</li> </ol>
|wifi|
IoT device's soft access point module dropping out at trade show
2924
<p>I have been developing a Wi-Fi remote access IoT device for an electrical control to display at an engineering trade show coming up. Unfortunately I was unable to attend this trade show due to health reasons</p> <p>The problem is that my fellow employees were unable to successfully connect to the IoT device in soft access point mode. They reported seeing it in their Wi-Fi devices and being able to connect to it, but then having the Wi-Fi connection drop out.</p> <p>Being a engineering trade show I am guessing that there would be lots of IoT devices and sometimes in large crowds I have experience my mobile phone network go down. Could other IoT devices be fighting for the Wi-Fi channels and hijacking our connection? I’m confused as I never experience this in the workspace environment while developing the firmware.</p>
2018-05-10T08:33:18.910
<p>Ok guys, so thank you for the comments, I've managed to solve the issue by using MQTT for feedback data as mentioned before by @Sean. problem solved! </p>
|wifi|microcontrollers|protocols|
WiFi communication between PC and embedded system on LAN
2927
<p>I'm here asking some support for a newbie in embedded communication.</p> <p>My situation is the following:</p> <ul> <li>embedded device: STM32L4xx microcontroller + ATWINC1500 wifi module</li> <li>WiFi management code (driver) already written and working</li> </ul> <p><strong>My goal:</strong> create a connection between the embedded system and a PC via WiFi, having both PC and device on the same LAN, in order to allow the PC to send files to the device, and send feedbacks from the device back to the PC.</p> <p>The problem is that I do not know basically how to approach the problem, because is my first project that relies on wifi connectivity. The main thing I think I'd should do will be define a custom communication protocol, in order to let the two actors talk to each other. The flow, in my opinion, should be:</p> <ol> <li>set up a stable connection (UDP or TCP, I have to determine also this) between the two actors</li> <li>on the PC side, create an application that sends the data to the device</li> <li>device side, write an handler for the incoming packets and manage the arrival of them</li> <li>device side, send the feedback to the PC once the data are arrived safely(check the correctness via checksum).</li> </ol> <p>Do you guys think that the above could be a good starting point? Do you have any documentation online to share with me that could clarify my doubts or give me some starting point to follow?</p>
2018-05-11T08:35:34.630
<p>I think it's non-existent today.</p> <p>I work at a Dutch municipality and, though things might have changed now, in December 2017 our environmental department concluded that even semi-professional gas or dust sensors were just not good enough to determine the low levels needed for outdoor measurements. (Including everything Libelium offered at that time for CO, NOx and particulate matter.) </p> <p>It's not my cup of tea, but the reasoning of our environmental department:</p> <ul> <li><p>For <a href="https://en.wikipedia.org/wiki/Particulates" rel="nofollow noreferrer">particulate matter</a> Libelium claimed to count PM 1. But outdoor measurements would only make sense for PM 0.1 (particulates smaller than 0.1 micrometer). Also, the weight of the counted particulates is not a constant, so converting the counts into some μg/m<sup>3</sup> value, to compare to government regulations, is difficult if not impossible.</p></li> <li><p>For NO<sub>2</sub> Libelium claimed an accuracy of 0.1&nbsp;ppm (parts per million) in ideal conditions. With, for NO<sub>2</sub>, 1&nbsp;pbb (parts per billion) being equal to<sup>†</sup> about 1.88&nbsp;μg/m<sup>3</sup>, a claimed accuracy of 0.1&nbsp;ppm = 100&nbsp;ppb = about 188&nbsp;μg/m<sup>3</sup>. But outdoor hourly averages of NO<sub>2</sub> concentrations vary between 1&nbsp;μg/m<sup>3</sup> and 60&nbsp;μg/m<sup>3</sup>, and the Dutch government indicators define an upper limit for the annual average of 40&nbsp;μg/m<sup>3</sup>. So, a claimed accuracy of 188&nbsp;μg/m<sup>3</sup> does not suffice.</p></li> <li><p>Any other measurements other than (ultra) fine dust and NO<sub>2</sub> were deemed not interesting for air quality. </p></li> </ul> <p>Of course, combining a lot of low-cost measurements and comparing those to the results of (very expensive) professional measurements might still yield useful indicators.</p> <hr> <p><sup>†</sup> µg/m<sup>3</sup> = ppb × 12.187 × M / T, where µg/m<sup>3</sup> is micrograms of gaseous pollutant per cubic meter of ambient air, ppb is parts per billion by volume (i.e., volume of gaseous pollutant per 10<sup>9</sup> volumes of ambient air), M is the molecular weight of the gaseous pollutant, and T is the temperature in Kelvin. An atmospheric pressure of 1 atmosphere is assumed.</p> <p>So, for a temperature of 25 °C: 1&nbsp;ppb SO<sub>2</sub> = 2.62&nbsp;μg/m<sup>3</sup>; NO<sub>2</sub> = 1.88&nbsp;μg/m<sup>3</sup>; NO = 1.25&nbsp;μg/m<sup>3</sup>; O<sub>3</sub> = 2.00&nbsp;μg/m<sup>3</sup>; CO = 1.145&nbsp;μg/m<sup>3</sup>; Benzene = 3.19&nbsp;μg/m<sup>3</sup>.</p> <p>Source: <a href="https://www2.dmu.dk/AtmosphericEnvironment/Expost/database/docs/PPM_conversion.pdf" rel="nofollow noreferrer">DCE - Danish Centre For Environment And Energy</a>.</p>
|hardware|sensors|
What are affordable solutions to air quality monitoring system?
2935
<p>I would like to measure the air quality related to road traffic in a city for an IoT application.</p> <p>The European Environmental Agency has defined quality indicators (good, bad, etc) according to the concentration of some gases in the air such as CO, NOx etc. I want to measure the concentration in the air of these gases.</p> <p>I have come around the <a href="http://www.libelium.com/development/waspmote/" rel="noreferrer">Waspmote board</a> by Libellium which produces also some sensors boards. However the gas sensors, particularly the calibrated ones are really expensive. Does anyone know a more affordable solution or integrated product to measure air quality?</p>
2018-05-11T22:56:00.423
<p>LMiC does not tell your code when transmission has started, but <a href="https://github.com/matthijskooijman/arduino-lmic/blob/master/src/lmic/config.h#L23-L28" rel="noreferrer">you could enable debug logging</a>.</p> <p>When you're transmitting well below duty cycle limitations, then LMiC will often send almost immediately. It might postpone things:</p> <ul> <li><p>When using OTAA and the node has not joined yet, it will first try to join when the first packet is scheduled.</p></li> <li><p>When duty cycle limitations kick in it will wait for the next opportunity.</p></li> <li><p>After each uplink it will first listen for any downlinks, after exactly 1&nbsp;second (RX1) and 2&nbsp;seconds (RX2, if nothing received in RX1). </p></li> <li><p>When it did not receive a downlink, it will still not send for some time as it assumes the most nearby gateway might be sending a downlink that the node failed to recognize. As gateways are half-duplex, such gateway won't be listening for any uplinks during that time, so LMiC tries to be smart and postpones sending when it did not receive any downlink. For that, LMiC assumes SF12 in RX2, and <a href="https://www.thethingsnetwork.org/forum/t/lmics-tx-complete-event-takes-20-30-seconds-to-fire/2639/11" rel="noreferrer">will delay for another 3 seconds after RX2</a>.</p></li> </ul> <p>When a transmission and waiting for RX1 and RX2 (if applicable) have completed, you'll get the <code>EV_TXCOMPLETE</code> event. (But even then, it might still delay a next transmission for 3 seconds; see above.)</p> <p>Peeking at some old code I once used, <strong>it seems</strong> you could guess if it's sending right away by using:</p> <pre class="lang-cpp prettyprint-override"><code>LMIC_setTxData2(1, mydata, sizeof(mydata)-1, 0); // At this point LMIC.txend is still the end time of the last packet? if(LMIC.txend &lt; os_getTime()) { Serial.print(F("Will send right away")); } else { Serial.print(F("Packet queued")); } </code></pre> <p>(But: not tested right now.)</p> <p>That said, to debug your actual problems:</p> <ul> <li><p>When using ABP, ensure you <a href="https://www.thethingsnetwork.org/forum/t/abp-node-stopped-working-fixed-by-creating-new-abp-why/3200/7" rel="noreferrer">disable the TTN frame counter check during testing</a>.</p></li> <li><p>When using a single-channel test gateway, <a href="https://www.thethingsnetwork.org/forum/t/can-lmic-1-6-be-set-up-to-use-a-single-channel-and-sf/5207/11" rel="noreferrer">ensure your node is only using that very same channel</a> and spreading factor. When not doing that, the node will choose one of eight standard frequencies each time, and you'll receive at most 1/8th of the transmitted messages.</p></li> <li><p>Don't put your node too close to the gateway; leave at least 3 meters between the devices.</p></li> </ul> <p>And above all:</p> <blockquote> <p>I use the following example of an abp-activated lowawan node:</p> <p><a href="https://github.com/matthijskooijman/arduino-lmic/blob/master/examples/ttn-otaa/ttn-otaa.ino" rel="noreferrer">https://github.com/matthijskooijman/arduino-lmic/blob/master/examples/ttn-otaa/ttn-otaa.ino</a></p> </blockquote> <p>That example is for OTAA, not for ABP. (And the single-channel test gateway you're using <a href="https://github.com/tftelkamp/single_chan_pkt_fwd" rel="noreferrer">is deprecated</a> and does not support downlinks, hence no OTAA either.)</p>
|lora|lorawan|
Arduino LMIC: Figuring out when packet transmission has been started on Chip
2939
<p>I use the following example of an ABP-activated LoRaWaN node:</p> <p><a href="https://github.com/matthijskooijman/arduino-lmic/blob/master/examples/ttn-otaa/ttn-otaa.ino" rel="nofollow noreferrer">https://github.com/matthijskooijman/arduino-lmic/blob/master/examples/ttn-otaa/ttn-otaa.ino</a></p> <p>But for some reason I cannot figure out when the node transmits some data or not. As far I see from this snippet:</p> <pre class="lang-cpp prettyprint-override"><code>LMIC_setTxData2(1, mydata, sizeof(mydata)-1, 0); Serial.println(F(&quot;Packet queued&quot;)); </code></pre> <p>The packets are inserted into a queue and then transmitted when available. So how I will make the ABP-example to give me an indication when the dragino-shield/hopeRFM9x starts transmitting the physical package that is in the queue?</p> <p>I am asking because the single-channel-gateway for some reason pings the TTN that exists via Semtech UDP <code>stat</code> message and barely receives any message to transmit. So I want to debug it, therefore I need a more verbose log on when <code>physical</code> transmission started and ended of a queued packet. I occasionally I get some messages when I power off and power on my LoRaWAN node.</p> <p>Also I may not get any message at all on my LoRaWaN single channel gateway even if I run the setup over 30mins with the Arduino being the only one node on my application and the node be next to my packet forwarder.</p> <p>Over my gateway I used the instructions in: <a href="http://www.instructables.com/id/Use-Lora-Shield-and-RPi-to-Build-a-LoRaWAN-Gateway/" rel="nofollow noreferrer">http://www.instructables.com/id/Use-Lora-Shield-and-RPi-to-Build-a-LoRaWAN-Gateway/</a></p> <p>For my packet forwarder I used the following implementation: <a href="https://github.com/tftelkamp/single_chan_pkt_fwd" rel="nofollow noreferrer">https://github.com/tftelkamp/single_chan_pkt_fwd</a></p> <p>Also I have configured my TTN application to use the legacy Semtech packet forwarder.</p>
2018-05-15T14:12:13.737
<p>If two devices are already bonded and one of them is mains powered, you should be able to establish the connection in way less than 1 sec given that the mains powered device is constantly scanning or advertising, you're using directed advertisements, white listing, and low connection intervals in the first second. </p> <p>Another option is to keep the connection alive at all times while maintaining a low latency. The maximum recommended supervisory timeout is 15 seconds, this means that the Central must receive a packet from the Peripheral at least every 15 seconds or else it will drop the connection. On the other hand you don't want to have a connection interval of 15 seconds, and that is when you use Slave Latency, this enables the Peripheral ignore X amounts of connection interval without losing the connection to its Central. So with a Connection interval of 500ms and a slave latency of 30 you will be asleep (15000-1)/15000 = >99.99% of the time and have 500ms latency when you do want to communicate.</p> <p>I estimate &lt;2µA average current to keep the connection alive. You will have to compare it with the average current consumption of an fast re-connection style, but I doubt that keeping the connection alive consumes more energy on average than re-connecting on demand. </p>
|bluetooth-low-energy|
Rapid pairing of Bluetooth low energy interface
2948
<p>I'm looking at making a remote control for a custom IoT device using Bluetooth low energy (BLE) and I want the battery in the remote to last a very long time (primary battery, non rechargeable) so I don't want the remote to draw power (at all) except when it's used. </p> <p>My issue is that as a remote control Bluetooth usually takes a few seconds to pair once activated. Is there a way to mitigate that few seconds of lag? Everyone hates lag in a remote. </p>
2018-05-15T17:57:42.627
<p>The <a href="https://www.logitech.com/en-us/product/harmony-hub?crid=60" rel="noreferrer">Logitech Harmony Hub</a> is a smart hub that can control devices via infrared (like your TV remote), and is <a href="https://www.logitech.com/en-us/product/harmony-hub/page/harmony-alexa" rel="noreferrer">compatible with Alexa</a>. It doesn't work via ZigBee, though — it connects via Wi-Fi to your Echo instead.</p> <p>You can see if it's compatible with your device on the <a href="https://support.myharmony.com/en-gb/compatibility" rel="noreferrer">compatibility page</a>; as of writing, Logitech claim that the hub is compatible with over 270,000 devices, so I suspect your TV should be supported.</p> <p>Alternatively, you could consider one of various other infrared skills and hubs compatible with Alexa, such as <a href="https://rads.stackoverflow.com/amzn/click/B018YICXQS" rel="noreferrer">this skill</a> which can use a phone with an IR blaster to send the necessary signals. I think you're less likely to find something specifically designed to work with the Hue's network for this purpose, and Wi-Fi based devices are a little more common. The Harmony is the one that is probably most well-known and compatble at the moment.</p>
|zigbee|samsung-smartthings|philips-hue|infrared|
Control Samsung Smart TV (Infrared Remote) via Hue / Zigbee?
2949
<p>Is there any possible way to remote control my Samsung Smart TV (which has an infrared remote) via my Philips Hue system, which communicates over Zigbee? </p> <p>It seems like ORVIBO is producing such stuff, but I can't find any further information, nor a retailer in Germany. I would like to tell Alexa/Siri to "Switch on my TV", which then triggers another device to send the "switch on" signal via infrared. A Zigbee plug is not an option for me, as it would switch off the TV hard.</p> <p>Using Hue would be optimal as I use it for everything, but any idea of achieving this in any way would be nice.</p>
2018-05-16T05:37:20.040
<p>MQTT should be more than fast enough for your architecture, given a decent WiFi network. I run about 30 sensors (ESP8266, Feather MO, Arduino Uno, etc.) all using MQTT back to a Mosquitto Broker running as a Docker Container on an 15yo laptop, which connects back out to my control software and displays, and it all works just fine. I'm pushing close to 2 million MQTT packets a day at my house...so your 864k seems do-able to me :)</p>
|mqtt|raspberry-pi|esp8266|streaming|web-sockets|
Network type for streaming from RPi to several ESP8266 modules
2951
<p>I would like to host a web page from a RPi that has websocket controls that update in 'real time' such as a slider that transmits its value as you move it. I then want to broadcast the values to several ESP8266 modules (~10) running Arduino via Wi-Fi. I would like to have a payload data rate of ~10 bytes/packet x 30Hz = 300 Bytes/s. </p> <p>What type of connection should I use for the Pi to the ESP8266s? I think MQTT is too slow for this? </p>
2018-05-17T13:38:02.313
<p>The Sim808 is a cellular GPRS data device (<a href="https://www.adafruit.com/product/2637" rel="nofollow noreferrer">https://www.adafruit.com/product/2637</a>), so getting data from it to a Raspberry Pi will depend on limits your wireless carrier has on the service that you have to sign up for. The data will have to travel from the Sim808, to the wireless carrier's data service that the Sim808 is connected to, out to the Internet, then to a publicly addressable node on your network (should be a Firewall) that is connected to the Internet, and then over to your Raspberry Pi MQTT broker. This could be a very expensive way to get data to your MQTT broker, especially if both devices are relatively close. Have you thought about using WiFi? If your sensor is going to be sending data at a high rate, you could easily go over your wireless service's data plan, and end up with a very large bill at the end of the month :(</p>
|mqtt|
MQTT protocol between RPi and sim808
2958
<p>I have an mqtt broker installed on RPi. I want to send data meseaured from a sensor attached to Arduino to the broker in the RPi. For this I am using a sim808. I know that mqtt works in LAN how can I set a LAN between the RPi and the sim808</p>
2018-05-23T05:55:57.890
<p>There are few models available in market with 180 degree capability including:</p> <p>Sky Bell HD</p> <p>Ring Video Doorbell</p> <p>Vivint Doorbell Camera</p> <p>But these are not having 4K quality on video. Please refer below site for more details:</p> <p><a href="http://mobilesiri.com/best-wireless-doorbell-camera/" rel="nofollow noreferrer">http://mobilesiri.com/best-wireless-doorbell-camera/</a></p>
|smart-home|surveillance-cameras|door-sensor|
Door bell with Wi-Fi camera
2977
<p>I'm looking for a door bell with a camera I would prefer something like 180° fish eye with 4k, but I guess there is nothing on the market so 160° with FullHD should work too. Should I mention that I want night vision too? ;)</p> <p>I checked NEST Hello, the ring.com door bells and August Doorbell. They are almost perfect, but they all rely on the fact that the video signal cannot been stored locally without an cloud and expensive subscriptions.</p> <p>Is there something which I may have missed?</p>
2018-05-23T22:13:54.690
<p>I've found this library useful to solve issues with authentication. If you encountered same issues on GSM modules with Arduino, it may help you as well:</p> <p><a href="https://github.com/elementzonline/SIM800_MQTT" rel="nofollow noreferrer">https://github.com/elementzonline/SIM800_MQTT</a></p>
|mqtt|gsm|authentication|
Connecting a SIM800L to a IBM BlueMix Server via MQTT
2986
<p>I am trying to connect a IoT node to a IBM IoT server via MQTT/GSM. I am using a Sim800L GSM module, and a serial USB device to send the commands to module from my computer. Later on, I will use the commands on Arduino to register my device. I'm sending following command to GSM Module:</p> <pre><code>AT+CIPSTART="TCP","[my-org-id].messaging.internetofthings.ibmcloud.com","my-port" </code></pre> <p>And I get the following output</p> <pre><code>CONNECT OK </code></pre> <p>But for connecting my device to BlueMix, I need to submit username and password. There isn't any documentation that I find on doing that, so i tried that:</p> <pre><code>AT+CIPSEND &gt;usernamepassword SEND OK </code></pre> <p>And after a few seconds after sending that:</p> <pre><code>CONNECTION CLOSED </code></pre> <p>So I think that this is not a valid way to submitting user and password. But I couldn't find any documentation about authentication on MQTT with GSM.</p>
2018-05-27T00:14:28.840
<ul> <li>Buy sonoff switches</li> <li>Flash with MQTT firmware (<a href="https://github.com/arendst/Sonoff-Tasmota" rel="noreferrer">https://github.com/arendst/Sonoff-Tasmota</a>)</li> <li>Add to wifi</li> <li>Send MQTT messages from the Pi to control the switch</li> </ul> <p>You can also use something like <a href="http://nodered.org/" rel="noreferrer">Node-RED</a> (comes pre installed in raspbian) and the <a href="https://flows.nodered.org/node/node-red-contrib-alexa-home-skill" rel="noreferrer">node-red-contrib-alexa-home-skill</a> (I wrote this node) to send the messages and have more control than just the actions that Wemo supports.</p>
|smart-home|alexa|raspberry-pi|wireless|wemo|
How to Use Alexa & Raspberry Pi switch things wirelessly?
2993
<p>I wanted to use my Amazon Echo Dot to connect to my Raspberry Pi, and have it turn on switches wirelessly. </p> <p><strong>What I have done:</strong> I have been able to use <a href="https://github.com/makermusings/fauxmo" rel="nofollow noreferrer">Makermusings's Fauxmo</a> and a <a href="https://rads.stackoverflow.com/amzn/click/com/B00KTELP3I" rel="nofollow noreferrer" rel="nofollow noreferrer">relay board</a> to "trick" Alexa to think that the Raspberry Pi is a <a href="http://www.belkin.com/us/Products/home-automation/c/wemo-home-automation/" rel="nofollow noreferrer">Wemo</a> device, and switch things on and off. However, that limits one to set all of the desired devices around a single area that is close to the Raspberry Pi. </p> <p><strong>I wanted to do the following:</strong> </p> <ol> <li>Say command: "Alexa, turn on lamp" </li> <li>Alexa sends command to Raspberry Pi through Fauxmo </li> <li>Raspberry Pi turns on a switch far away that may be in the kitchen, but would use some sort of wireless switch</li> </ol> <p><strong>Question:</strong> How can I control a switch wirelessly through Alexa/Raspberry Pi?</p>
2018-05-27T20:16:42.887
<ol> <li><p>Download putty as need of 64 bit or 32 bit</p></li> <li><p>Open the command prompt at the Windows iot core OS</p></li> <li><p>Give "ipconfig" and note the ipv4 address.</p></li> <li><p>Now add your network with the raspberry pi board ip address </p> <ul> <li>netsh method</li> <li>advanced settings method</li> </ul></li> <li><p>After known the ip just open the putty and put your id there select ssh and open the putty</p></li> <li><p>Give the user name and password</p></li> <li>Now you can easily access the SSH service of the windows IOT core ... </li> </ol>
|raspberry-pi|microsoft-windows-iot|
SSH to Raspberry with Windows 10 IoT
2995
<p>I set up a Raspberry Pi 3b with Windows 10 IoT to try it out. In the past I had Linux running and I would just ssh connect to it. However when trying to ssh from powershell to the Windows 10 IoT it would fail with this error:</p> <pre><code>Unable to negotiate with 10.155.41.47 port 22: no matching cipher found. Their offer: aes256-cbc,aes192-cbc,aes128-cbc </code></pre> <p>I use this command:</p> <pre><code>ssh administrator@10.155.41.47 </code></pre> <p>Is it just not possible to ssh from Windows 10 with Powershell to Windows 10 IoT?</p>
2018-05-29T10:19:34.293
<p>The Tradfri gateway is not a WPS certified or a wi-fi certified product, it's a wired product to your router.</p> <p>The app is only usable when connected to your router's wifi. If you want to control devices outside of the wifi network, you must enaled Google Assistant or Amazon Alexa. Tradfri bulbs and remotes are also compatible Philips Hue or Smartthings, you can use the tradfri devices standalone on these 2 systems but without the gateway you won't receive firmware updates.</p>
|ikea-tradfri|
How to connect IKEA Tradfri Gateway to a WiFI?
3002
<p>The IKEA Tradfri gateway comes with an Ethernet cable but everyone online talks about it being connected to a WiFi. I find teardowns of the hardware that it has WiFi chips and there is a "connect" button on it.</p> <p>But how to I actually connect to a WiFi? The connect button doesn't connect it with WPS (my first thought), the Tradfri app doesn't have any Wifi settings section - what am I doing wrong?</p>
2018-05-30T08:00:09.587
<p><code>allow_anonymous false</code> needs to be in the mosquitto.conf file not the acl file</p> <p>IIRC the logging is delayed because of a minor bug in some versions of mosquitto because you are not driving any other load through the broker</p>
|mqtt|security|mosquitto|authentication|
mosquitto - allow_anonymous false shows connected message
3008
<p>I have set the <code>acl_file</code> property in <code>/etc/mosquitto/mosquitto.conf</code> to <code>/home/ubuntu/my.acl</code>. In the ACL file, I have <code>allow_anonymous false</code> to disallow connections from clients that do not have user name.</p> <p>From MQTT Lens, I tried connecting to this broker without passing user name. I don't see a connect message immediately in the log. However, when I delete the connection from MQTT Lens, I see the message as connected followed by a disconnect message.</p> <pre><code>ubuntu@ip-172-31-42-207:/var/log/mosquitto$ tail -f mosquitto.log 1527666604: New connection from 183.xx.xx.xx on port 1883. 1527666604: New client connected from 183.xx.xx.xx as lens_bWIkzTxFSc2BIIUQqqT35ipsiPV (c1, k120). 1527666746: Client lens_bWIkzTxFSc2BIIUQqqT35ipsiPV disconnected. </code></pre> <p>How can I confirm that <code>allow_anonymous false</code> actually denied the connection?</p>
2018-06-03T17:55:08.577
<p>The reasons are purely technical.</p> <p>In a SX127x chips, the PHY header in explicit header mode is always 28 bits long and must fit into the first 8 symbols that are hard-codded at CR 4/8 redundancy. At SF7, 8 symbols at CR 4/8 encode exactly 28 bits. At SF6, only 24 bits, that's not enough. And if you can't send an explicit header, you can't send a variable-length frame, so no SF6 LoRaWAN frame. SX126x chips get their new framing engine from the SX128x but have to stay compatible with the established SX127x and SX130x base, so no SF6 LoRaWAN either.</p> <p>SF13 is possible but you would have to double the size of the FFT unit and buffers in the chip, increasing price, for a diminishing return. It was considered not worth it.</p>
|lora|lorawan|
Spreading Factor of LoRa
3025
<p>I am new to LoRa technology and I was reading it's technical specifications on the lora-alliance.org website. In the document, the SF is always considered between 7-12. What is the reason behind not considering the values beyond this range, for say SF6 or SF13? Is it because of receiver sensitivity, or there is a mathematical reason behind it?</p>
2018-06-04T22:44:08.303
<p>The MQTT spec lists the details of the <a href="http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718081" rel="noreferrer">PINGREQ</a> and <a href="http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718086" rel="noreferrer">PINGRESP</a> packets which make up the keep-alive transaction.</p> <p>Each is just 2 bytes in size so a full keep-alive event uses 4 bytes in total. Since you can control how often keep-alive packets are sent for each client based on how quickly you need to know that connection has dropped you have full control how much data is used when no messages are actually being published.</p> <p>If you want to reduce the data load even more you could have a separate broker running before the 4G router that the 10 devices connect to which is then bridged to the central broker. This would reduce the number of keep-alive packets to 1 per 4G router rather than 1 per client. This has the advantage that the 10 local devices can continue to pass messages between each other if the link goes down and you can use retained messages/Last Will and Testement messages to track when individual clients go down.</p>
|mqtt|
MQTT always connected and 4G data load
3026
<p>I'm working on an IoT project that involves thousands of MQTT clients that are connected to a broker (mosquitto) via 4G/WiFi router/modem. Less than 10 clients are connected to the same router, and the routers come from different places (different cities).</p> <p>Right now we have very few clients and they are always-connected to the broker. I know from this <a href="https://iot.stackexchange.com/questions/2659/is-mqtt-scalable-with-1000-clients">discussion</a> that there will be no problems even when they will grow up to 1000+ units.</p> <p>My question is about the traffic load on the 4G connection. The end-user is afraid about data consumption with all those "channels" opened and not used. <em>As far as I understand when there is no activity only the keep-alive packets are sent</em>, though I cannot find this information for sure in the MQTT documentation.</p> <p>Can I assume the traffic when no packets are published is negligible?</p>
2018-06-09T20:04:17.147
<p>Well, I am a big fan of the <a href="https://onion.io/omega2/" rel="noreferrer">Omega 2</a>, which is not much bigger than a full size SIM card or SD card. It runs Linux, so there is your TCP/IP stack.</p> <p><a href="https://i.stack.imgur.com/EmOeX.png" rel="noreferrer"><img src="https://i.stack.imgur.com/EmOeX.png" alt="enter image description here"></a></p> <p>It has a good spec and will set you back a whopping $13.</p> <blockquote> <pre><code>580MHz MIPS CPU 128MB Memory 32MB Storage USB2.0 support 2.4GHz b/g/n WiFi 3.3V Operating Voltage 18 GPIOs Support for UART, I2C, SPI MicroSD slot </code></pre> </blockquote> <p>Just by coincidence, I received their newsletter about 20 minutes ago and it describes <a href="https://onion.io/2bt-june-12-2018/" rel="noreferrer">a PoE project</a>.</p> <p>That will set you back another few bucks, so I will leave it to you to decide if it is "cheap". Hope this helps.</p>
|hardware|microcontrollers|ethernet|
Cheap PoE board with TCP/IP support
3034
<p>I have a small IoT project where I want a network enabled electrical relay. I do not need full network plug nor linux on it. It just should be small and cheap. I feel smart enough to write a small http server in C/C++ (if required) to change the state of the relay. I searched of cause the web and found the almost matching dublicate <a href="https://iot.stackexchange.com/questions/1005/cheap-iot-microcontroller-with-poe">Cheap IoT microcontroller with PoE</a></p> <p>However this is much bigger then what I have in mind. I want a small board with 6 skews to mount the wires (2 or more replays would be fine too). I want to control a device for with less then 25V (I'm not sure but very likely 12V DC). However I do not want to write the TCP/IP stack by my own.</p> <p>Any ideas?</p>
2018-06-09T20:06:57.663
<p><a href="https://www.vesternet.com/what-is-z-wave-plus" rel="nofollow noreferrer">Vesternet</a> claim that:</p> <blockquote> <p>The main consideration is the Z-Wave controller - if the controller is not Z-Wave Plus enabled then all devices added to that controller's network will default to acting as Z-Wave. This is because Z-Wave Plus is back-wards compatible with Z-Wave devices, when it is installed with Z-Wave devices it behaves just like a Z-Wave device as those existing devices have no way to communicate with it using Z-Wave Plus commands.</p> </blockquote> <p>It's stated on the <a href="https://community.openhab.org/t/z-wave-plus-devices-with-old-z-wave-controller/3551" rel="nofollow noreferrer">OpenHAB forums</a> that Z-Wave Plus devices can still be controlled using their bindings for Z-Wave, which would indicate that you shouldn't lose any functionality.</p> <p>It seems that the only thing that you miss out on is the protocol improvements such as lower power usage and increased fault tolerance; actual functionality is unchanged even if you use an old Z-Wave controller.</p>
|samsung-smartthings|zwave|
Z-Wave Plus Backwards Compatibility
3035
<p>So, as I understand the Z-Wave Plus backwards compatibility requirements cover communication between Z-Wave Plus and original Z-Wave devices. Personally, I specifically take "devices" as the IoT term for sensors and other IoT objects.</p> <p><strong>My question is whether or not the backwards compatibility also applies to a Hub or controller (specifically the SmartThings Hub v1)?</strong></p> <p>I found this post to be slightly confusing, stating 1) that <em>you need the controller to be Z-Wave Plus</em>, but 2) <em>you won't get all of the advantages</em>. Ultimately, I have not found a source definitively saying Yes or No to whether the v1 hub (original Z-Wave) can control a Z-Wave Plus device.</p>
2018-06-10T14:54:52.400
<p>Insteon components can be used stand-alone without a hub. </p> <p>Purchase any combination of <a href="https://www.smarthome.com/lamplinc-insteon-2457d2-plug-in-lamp-dimmer-module-dual-band-2-pin.html" rel="noreferrer">dimming plugin module</a>, <a href="https://www.smarthome.com/insteon-2635-222-on-off-module.html" rel="noreferrer">on/off plugin module</a>, or <a href="https://www.smarthome.com/insteon-2663-222-on-off-outlet-white.html" rel="noreferrer">duplex outlet</a> (dual control-each outlet can be controlled separately or linked together).</p> <p>Replace a <a href="https://www.smarthome.com/switchlinc-dimmer-insteon-2477d-remote-control-dimmer-dual-band-white.html" rel="noreferrer">wall switch</a> and link it all together manually. You will get exactly what you asked for, the ability turn on/off one switch and have multiple things turn on/off. You can also add many more devices (now or later) than you will ever need... you can keep it super simple or make it very complex.</p> <p>Manual linking does work, but is a tedious process with a learning curve. You can also add a <a href="https://www.smarthome.com/insteon-2245-222-hub.html" rel="noreferrer">hub</a> which gives you all those things you don’t want, like internet, schedules, remote from your phone etc etc. but with the added advantage of more simplified setup. (No manual linking -much easier to do linking with hub). <strong>AND</strong> once the modules are setup (I.e. linked or programmed) the hub can be unplugged and put away and it all continues to work standalone without the hub. I mention that because there are <a href="https://www.smarthome.com/insteon/insteon-starter-kits.html" rel="noreferrer">bundles and starter kits</a> that make the <a href="https://www.smarthome.com/insteon-2244-234-starter-kit.html" rel="noreferrer">hub essentially free</a>.</p> <p>Not obvious to newcomers: 1) Insteon and smarthome.com have the same owner, it’s always least expensive to buy direct from smarthome.com 2) smarthome has lots of sales and promos, never pay the regular website full price. Also don’t miss the <a href="https://www.smarthome.com/starter-kits-multi-packs/multi-packs.html" rel="noreferrer">multi-packs</a> that also save. 3) many items are available on amazon but mostly avoid it, some of the product has really old date codes and firmware when purchased through amazon.</p> <p>Many Insteon items are available in other electrical standards than USA. Such as European, although it’s easier to see compatibility from the country in question, the US site doesn’t show all international product. <a href="https://www.insteon.com/where-to-buy/" rel="noreferrer">See here for more international purchasing options</a>.</p> <p>Disclaimer: I don’t work at smarthome/Insteon. I just have a huge complicated Insteon system with over 100 switches and modules. (The only two non-Insteon switches in my house both control garbage disposals.)</p>
|smart-lights|
Do simple, wirelessly connected, but not battery powered switches exist?
3041
<p>I can’t find this despite lots of googling: I want to flip a switch in my living room and have every floor lamp turn on also. But I don’t need a remote, I don’t need internet connectivity, I don’t need schedules, and I definitely don’t want anything battery powered. “Just” one central classic switch which has multiple plugs slaved to it, so they operate with its status.</p> <p>In my imagination this would involve swapping the wall switch with something smart, and it and the main light would continue being connected to the outlet as normal. And then a couple slaved plugs that connect to normal wall sockets that turn the lamps on and off.</p> <p>What I’m looking for is simplicity. No fancy colours, no remotes to recharge. Am I missing a google keyword? I’m an IoT virgin, so far my findings are dominated by SmartThings and Hues and remotes and hubs, and it all seems too complicated for my needs. Any insights, suggestions, or gentle introductions welcome.</p>
2018-06-13T06:43:05.023
<p>Not the complete answer but a step forward: <a href="https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html" rel="noreferrer">https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html</a></p> <p>AWS has released their ESP32 support with AWS FreeRTOS. </p> <p>To send directly to S3 without going through IoT Core, you will need your endpoint (obviously) and certificates on the device side to authenticate on the Cloud side. With the policies and Roles on the Cloud side, a trusted device should be able to post on S3. </p>
|aws|esp32|
Data from ESP32 to AWS S3
3049
<p>Can someone here help me out with code to send data from esp32 to aws s3 storage ?</p> <p>I am using esp-idf as I have other code running on the esp32 as well.</p> <p>I am new to aws so any help would be good.</p>
2018-06-14T11:25:42.767
<p>What you've written all seems reasonable to me.</p> <p>MQTT traditionally runs over TCP<sup>1</sup>, but your browser does not allow webpages to open a raw TCP socket. There are <a href="https://www.w3.org/TR/2013/WD-raw-sockets-20130514/" rel="noreferrer">proposals</a> to allow that, but I doubt they'll be implemented any time soon. So, your browser can't connect to a MQTT broker only supporting TCP connections.</p> <p>The solution is, as you've identified, to use a <em>WebSocket</em>—these are supported by the browser and so some JavaScript code can be used to connect to an MQTT broker through a web page. HiveMQ have <a href="http://www.hivemq.com/demos/websocket-client/" rel="noreferrer">an example you can play with</a>, or you can try a library such as <a href="https://github.com/mqttjs/MQTT.js" rel="noreferrer">MQTT.js</a> which supports WebSocket communication with an MQTT broker.</p> <p>Most brokers—and all I'm aware of—won't care about whether a client is a WebSocket or TCP client. You can happily connect both to one broker, and you can find instructions on how to configure a Mosquitto broker <a href="https://stackoverflow.com/q/34408624/6650102">on Stack Overflow</a><sup>2</sup>.</p> <p>With regards to a best way... it's up to you. If you are happy with JavaScript, then there's no problem using that. If Python's easier, do that (you wouldn't need to set up WebSockets support that way). You could even just use pre-built client software if you didn't care about the UI too much.</p> <hr> <p><sup>1 MQTT 3.1.1 does allow for TLS or WebSocket connections also; see <a href="http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html" rel="noreferrer">section 4.2 of the specification</a>. There is a variant, <a href="http://mqtt.org/new/wp-content/uploads/2009/06/MQTT-SN_spec_v1.2.pdf" rel="noreferrer">MQTT-SN</a>, where the requirement for TCP is relaxed. Either way, you're probably not worried about MQTT-SN for your use case.</sup></p> <p><sup>2 Note that on Windows, the <a href="https://iot.stackexchange.com/q/1205/12">Mosquitto build does not have WebSocket support enabled</a>. You will need to build Mosquitto yourself if you want to use it on Windows. Alternatively, you could try a different broker that doesn't restrict you in this way.</sup></p>
|mqtt|raspberry-pi|arduino|
Control arduino via MQTT
3057
<p>I working with several arduino board and now I need to control them via a web interface. </p> <p>Via web interface I want to activate GPIO.</p> <p>I have two ideas:</p> <ol> <li>Each arduino acts as web server and I can control the GPIO via the Arduino web page. Basically one browser tab for each arduino.</li> <li>Use the MQTT protocol to exchange message with the arduino boards. Furthermore I think to use an raspberry as web server and as MQTT broker. Each arduino board is subscribed to a specific topic and through a web page, hosted on the raspberry, I can control the Arduino GPIOs.</li> </ol> <p>The first solution I very quicly and simple.</p> <p>Regarding the second option, I don't know how to send MQTT message via a web page. I read that I need to use Websocket. Is it right? Need I to write code in Javascript or what?</p> <p>My second question is: Can the MQTT broker manage both MQTT and MQTT over Websocket at the same time? Otherwise I need to use the Websocket also on Arduino.</p> <p>Another option is to built a Python script with GUI that allow to send MQTT messages to Arduino.</p> <p>Is there a best way?</p> <p>Thanks for the help!</p>
2018-06-18T05:14:29.253
<p>Industrial controllers are driven by really intense quality requirements. For example, a single controller may be responsible for a bioreactor growing a batch of culture worth $1,000,000USD to a manufacturer. Industrial controllers have to run for months and months without failure. </p> <p>In contrast, prototype, hobby and study controllers such as the Raspberry Pi and Arduino are designed to support exploration and teaching. Although quality is important, it is not a primary concern. For Raspberry Pi controllers, ease of use is paramount. Raspberry Pi excels at ease of use and is a rich platform for experimentation.</p> <p>Here's a specific example. Modern industrial controllers support web services for configuration, monitoring and maintenance. And when I set up my Raspberry Pi controller for aeroponics, I also use web services for the same reason. The Raspberry Pi supports many web servers and I chose NodeJS, which is based on Javascript. Javascript is an interpreted language with automatic memory management. Javascript is a wonderful language for experimentation and exploration. So is Python. But interpreted languages tend to die for mysterious reasons related to memory leaks and fragmentation. Which means my Raspberry Pi dies every now and then for mysterious reasons and has to be rebooted. </p> <p>These failures that I accept for the Raspberry Pi would be unacceptable for an industrial controller. For industrial controllers, I would choose a C++ web server such as <a href="https://github.com/cesanta/mongoose" rel="nofollow noreferrer">Mongoose</a>, which is small, simple and quite robust. Now I could certainly run Mongoose on the Raspberry Pi, but Raspbian itself might not be best for industrial control. Industrial controllers tend to have custom-built and tightly managed operating systems created by <a href="https://www.yoctoproject.org/" rel="nofollow noreferrer">Yocto</a></p> <p>Industrial controllers are often subject to <a href="https://ispe.org/initiatives/regulatory-resources/gmp/regulations" rel="nofollow noreferrer">strict regulations</a>, especially in the biotech sector, where mistakes can impact human life and welfare. Even simple things like enclosures are regulated. For example, an industrial controller enclosure is often subject to <a href="http://www.dsmt.com/resources/ip-rating-chart/" rel="nofollow noreferrer">"waterproofness ratings"</a>.</p> <p>Taken together, the stringent constraints on industrial controllers cost manufacturers and consumers a lot, but that cost provides high value in terms of safety and yield. Thankfully, many hobbyists are able to create controllers with equivalent functionality (but with less stringent quality) using MCUs such as Arduino and Raspberry Pi. Indeed the latter provide a fertile frontier of new ideas and techniques for all controllers.</p>
|raspberry-pi|microcontrollers|arduino|industry-4.0|plc|
Industrial Controller Vs Prototype Controller(Study level Controller)
3068
<p>What is the difference between industrial Controller and prototype(Study)level controllers or Raspberry pi/Arduino Vs. Industrial Controllers(PLC, NON PLC) controllers</p>
2018-06-22T08:53:02.983
<p>Thanks guys for the support. I've finally used the method described by Helmar in which I just try to reach the desired target and see. If I can obtain a reply from the target, I know that my connection is alive and functioning, otherwise I manage to disconnect the device and retry with a fresh new connection. </p>
|networking|microcontrollers|
Embedded C—check internet connection
3085
<p>Is there any way to check if actually my embedded device has a working connection (i.e. can reach the WAN)? My device has no RTOS, so I cannot rely on OS functionalities like ping. I can see that the DHCP gives a correct IP to my device, but it's not 100% true that given a correct IP I can then reach for example www.google.com.</p> <p>I've already done some research, and there are different approaches:</p> <ol> <li>it's impossible</li> <li>it's a stupid question</li> <li>workarounds of every sort, but I feel confident with respect to SO so I'll give it a try.</li> </ol> <p>So, if this is question has 1) or 2) as replies, I'll remove it and it's ok.</p>
2018-06-24T04:55:11.117
<p>Messages are persisted if</p> <ul> <li>they are retained</li> <li>while inflight and waiting to be acknowledged, QOS 1/2</li> <li>QOS 1/2 waiting to be delivered to an offline client that held a subscription to the topic before going offline</li> <li>Same as previous for QOS 0 messages if the <code>queue_qos0_messages</code> is set to true</li> </ul> <p>The whole message is stored in memory and sync'd to disk at regular intervals (controlled by the <code>autosave_interval</code> option) or when the broker shuts down to ensure data is not lost.</p> <p>As with all processes the current directory is the location where where the process was started e.g. if your shell is in your home directory <code>/home/user</code> when you run mosquitto then the current directory will be your home directory. When mosquitto is run as a service this will probably be / in which case the mosquitto user would not have permission to write there. It is always better to be explicit where to write logs and persistence data</p>
|mqtt|mosquitto|publish-subscriber|
mosquitto - persistence configuration options
3093
<p>I want to understand the persistence related options in Mosquitto as <a href="https://mosquitto.org/man/mosquitto-conf-5.html" rel="noreferrer">described</a> here.</p> <p>To begin with, do these options apply only in case of QoS > 0 and/or retained messages? </p> <ul> <li><code>persistence</code></li> </ul> <blockquote> <p>If true, connection, subscription and message data will be written to the disk in <code>mosquitto.db</code> at the location dictated by <code>persistence_location</code>.</p> </blockquote> <p>What is the meaning of 'message data' - the actual payload? Only when retained or otherwise as well?</p> <ul> <li><code>persistence_location</code></li> </ul> <blockquote> <p>If not given, then the current directory is used.</p> </blockquote> <p>What is the current directory relative to?</p>
2018-06-24T09:10:02.270
<p>It's worth remembering that everything in the NodeJS world is asynchronous which means nothing blocks the event loop.</p> <p>In this case it sounds like you get the first incoming message, which you store with a fixed key in the flow context, you then move on to the Select query. At this point the SQL node is going to end up doing some network IO which will block while it waits for a response from the database so while it waits it will give up the execution context.</p> <p>If while it's waiting a new MQTT messages arrives it will be handled immediately and passed to the first function node which is going to overwrite what ever was stored in the flows context because the key is the same.</p> <p>When the first Select statement returns the first message will move on to the second function node and when it retrieves the value from the flow context it will be the second message not the first.</p> <p>The way to solve this is to not use the context to keep state but to move the information you want to keep from <code>msg.payload</code> to a different key on the <code>msg</code> object. Well behaved Node-RED nodes should always pass on the original <code>msg</code> object and by default only really change the <code>msg.payload</code> (there are exceptions, but they tend to document what they change and why).</p> <p>Using the <code>msg</code> to hold state for a unit of work guarantees that it can only be changed in step with the message travelling through a flow.</p>
|mqtt|publish-subscriber|node-red|
node-red - Units of work
3095
<p>I have a MQTT Input node that kicks of database operations (SELECT and INSERT) for PostgreSQL database. The database operations are done with <a href="https://www.npmjs.com/package/node-red-contrib-postgres-multi" rel="noreferrer">node-contrib-postgres-multi</a>.Since these operations are separated by function nodes, I am saving portion of the message with <code>flow.set</code> and retrieving with <code>flow.get</code> later. For example,</p> <ul> <li>Function node saves with <code>flow.set</code> and generates <code>SELECT</code> query.</li> <li>Wire to PostgreSQL node.</li> <li>Parse output, use <code>flow.get</code> and generate <code>INSERT</code> statement.</li> <li>Wire to PostgreSQL node.</li> </ul> <p>I can't help but imagine that the <code>flow.set</code> and <code>flow.get</code> are not in sync. </p> <p>Currently, I am simulating around 20 devices to publish data every second with timestamp increased by 1 second for every publication. There is absolutely <strong>no reason</strong> why the generated messages should ever get duplicated. However, the database insert nodes fail because of unique index violation as seen in Node-RED log (<code>.pm2/logs/red-out-0.log</code>).</p> <p>If the function nodes and database processing take say, 2 seconds and the MQTT messages (QoS=0) are received every second, would MQTT or Node-RED buffer them? Therefore, every received message is treated as a Unit of Work until it errors out or 'leaves' the flow into a database, HTTP request, MQTT publish, etc. ?</p>
2018-06-25T11:39:50.253
<p><strong>I ran into a similar problem with a different solution</strong></p> <p>If you create a certificate using a default openssl.cnf, or some other mechanism that generates an SSL certificate such as PHP's openssl_csr_sign, make certain your generated certificate does not have the x509_extensions set to make a CA certificate.</p> <p>After three days of banging my head against the wall, I discovered that Amazon IoT will reject any device certificate that has CA:true set. Use OpenSSL to verify:</p> <p><code>openssl x509 -in deviceCertificate.pem -text -noout</code></p> <p>You should see something like this:</p> <pre><code> X509v3 extensions: X509v3 Basic Constraints: CA:FALSE </code></pre> <p>I hope this helps someone save some time.</p>
|aws|authentication|
AWS IoT Authentication - Using own certificate not working
3099
<p>I'm trying to set up AWS IoT authentication with using my own certificate according to the <a href="https://docs.aws.amazon.com/iot/latest/developerguide/device-certs-your-own.html" rel="noreferrer">docs</a>. I've managed to register a CA, enabled it as well as set it to auto-register. Also, created device cert &amp; key according to the docs. When I first connect my device using the freshly generated key &amp; cert it won't work. No sign of connection. It should publish a message to the <code>$aws/events/certificates/registered/caCertificateID</code> topic. In the MQTT console I'm unable to see anything in that topic. I've also tried attaching a template according to the <a href="https://docs.aws.amazon.com/iot/latest/developerguide/jit-provisioning.html" rel="noreferrer">JIT provisioning docs</a>, same, no luck, doesn't seem anything to be happening.</p> <p>When I manually register the device cert (<code>aws iot register-certificate --certificate-pem file://deviceCert.pem --ca-certificate-pem file://rootCA.pem</code>) it is then able to connect to AWS.</p> <p>What is going wrong?</p>
2018-06-25T13:03:27.640
<p>I agree to Aurora's answer—there may be better solutions to implement queue instead of MQTT, but still in MQTT it is absolutely possible.</p> <p>You need MQTT broker and clean=false (in MQTT 3.x) or with appropriate expiration period (MQTT 5.0). Then, the logic is pretty straightforward.</p> <p>You have persistent(but not connected) client session, that is subscribed with QoS=1 to correct topic to receive and buffer keys, published by your key-generator.</p> <p>Device connects, authorizes with given session using appropriate client_id and immediately receive keys. You should acknowledge only first key and then close connection.</p> <p>That is—you have one key in client and when MQTT broker receive ack for the packet, it will remove it from session storage.</p>
|mqtt|https|streaming|
Can MQTT be used for queuing?
3101
<p>I am building a project which has the following requirements:</p> <ol> <li>My hardware device (NanoPi) should access a broker for a video key.</li> <li>The broker should have a queue which will hold the video keys sent by the server and will forward it to the device on request.</li> <li>The device will push the video key to the remote server and request for the specific video.</li> <li>The remote server will send the video to the device and the device will display it on the monitor.</li> <li>On completion of the video, the device will again request for a new video key.</li> </ol> <p><strong>Which broker should I use which will store the video keys in a queue? Will a MQTT broker be suitable for my application? If not which other broker should I use?</strong> </p>
2018-06-26T15:04:06.253
<p>I believe the Ilumi light bulb gets as close to this as you can get. It uses bluetooth instead of wifi, but the principle is mostly the same. Basically, the situation is the following:</p> <ul> <li><p>If the light switch is turned on, you can control the lights over bluetooth. If the light switch is turned off, the light (and the whole system) is off no matter what.</p></li> <li><p>You can use the light switch to turn the light on or off</p> <ul> <li>if the light is on, turning the switch off turns the light off</li> <li>if the switch is on but the light is off, turning the switch off then on again, turns the light on</li> <li>if the switch is off, turning the switch on turns on the light</li> </ul></li> </ul> <p>In order to achieve this, they have the following properties:</p> <ul> <li>You can set a default color and intensity in the app, which is what the bulb will go to at "startup"</li> <li>This information is stored in the memory <em>that is in the bulb itself</em></li> <li>The bulb was built to survive cutting the power</li> </ul> <p>With these things in mind, it probably makes a lot of sense that the bulbs use mesh networking instead of a hub.</p> <p>I wouldn't exactly recommend getting these bulbs. That's mostly due to the behavior of the company, though. The mesh networking also isn't always the best, but it has definitely gotten better throughout their updates. However, I do still think that being able to use your normal light switch is the killer feature that all competitors seem to be missing.</p>
|smart-home|lighting|
Is it possible to control a home appliance remotely as well as using the switch to which it is connected?
3109
<p>Suppose I want to control my room lights over WiFi using mobile phone. But I also want to control them by using the switches in my room to which they are connected. Is it possible to implement them both? I watched and read a couple of tutorials on Home Automation over WiFi but they only focused on controlling the home appliances <em>remotely</em>. </p>
2018-06-27T13:27:57.947
<p>If you haven't created <code>/home/pi/bin/py.conf</code>... that's your problem.</p> <pre class="lang-py prettyprint-override"><code>config = configparser.ConfigParser() config.read('/home/pi/bin/py.conf') </code></pre> <p>That code tries to open the file <code>/home/pi/bin/py.conf</code> and read it using an <a href="https://docs.python.org/3/library/configparser.html" rel="noreferrer">INI-like format</a>. It turns that into a Python <code>dict</code>. Working back from the code, you need to add the following to <code>/home/pi/bin/py.conf</code>:</p> <pre><code>[MQTT] userMQTT = username passwdMQTT = password hostMQTT = broker address portMQTT = broker port </code></pre> <p>(filling in the details, of course)</p>
|mqtt|
KeyError while connectiong to a MQTT broker
3120
<p>This is my code and on the bottom is the error I keep getting.</p> <pre class="lang-python prettyprint-override"><code>import configparser from time import localtime, strftime import json import paho.mqtt.client as mqtt config = configparser.ConfigParser() config.read('/home/pi/bin/py.conf') # Broker connection config. requestTopic = 'services/timeservice/request/+' # Request comes in here. Note wildcard. responseTopic = 'services/timeservice/response/' # Response goes here. Request ID will be appended later def onConnect(client, userdata, flags, rc): print(&quot;Connected with result code &quot; + str(rc)) def onMessage(client, userdata, message): requestTopic = message.topic requestID = requestTopic.split('/')[3] # obtain requestID as last field from the topic print(&quot;Received a time request on topic &quot; + requestTopic + &quot;.&quot;) lTime = strftime('%H:%M:%S', localtime()) client.publish((responseTopic + requestID), payload=lTime, qos=0, retain=False) def onDisconnect(client, userdata, message): print(&quot;Disconnected from the broker.&quot;) # Create MQTT client instance mqttc = mqtt.Client(client_id='raspberrypi', clean_session=True) mqttc.on_connect = onConnect mqttc.on_message = onMessage mqttc.on_disconnect = onDisconnect </code></pre> <p>And after I try to connect to a broker:</p> <pre class="lang-python prettyprint-override"><code>mqttc.username_pw_set(config['MQTT']['userMQTT'], password=config['MQTT']['passwdMQTT']) mqttc.connect(config['MQTT']['hostMQTT'], port=int(config['MQTT']['portMQTT']), keepalive=60, bind_address=&quot;&quot;) </code></pre> <p>I get the fallowing error:</p> <pre><code>Traceback (most recent call last): File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; File &quot;/usr/lib/python3.5/configparser.py&quot;, line 956, in __getitem__ raise KeyError(key) KeyError: 'MQTT' </code></pre> <p>Does anybody know how to fix this error while trying to connect to a broker?</p>
2018-06-30T21:20:40.300
<p>Belkin have their <a href="http://www.belkin.com/us/p/P-F7C030/" rel="nofollow noreferrer">Wemo light switch</a>, which replaces a standard wall switch and allows remote control of ceiling lights.</p> <p>I haven't tried one, but I have the Wemo light bulbs and wireless sockets, and they work well with Home Assistant if you don't want to use Belkin's mobile app.</p> <p>(You still have to do the initial setup with the app, but once it's connected to your network you can ditch the app for HA)</p> <hr> <p>Edit: <a href="https://iot.stackexchange.com/a/3233/6426">This answer</a> mentions Bluetooth Low Energy switches which don't need batteries. I can't find them for sale online yet, though.</p>
|lighting|
Controlling WiFi switches from physical switch
3131
<p>I'm looking to install smart switches for my lighting. Since I have LED lights and 2-wire circuits to the switches (no neutral), I'm looking at wifi controlled remote relays - which I can find no problem.</p> <p>However, all these switches seem to integrate with smartphone apps - not with something I can fix to the wall in each room. Is there a good reason that I can't find a physical switch that can be hooked into some sort of smart control system? Obviously if there exists something, I can route it via IFTTT to close the loop (and remember that I need some legacy lighting just in case the network goes down)</p> <p>The closest I've found so far is a 433 MHz stick-on wall mount switch, and a 433MHz/WiFi relay - but I'm intrigued about why there is no existing product to meet this application. </p> <p>To clarify one specific use case, my wired switches seem to often turn out to be where I want some furniture - so I'm primarily looking to re-locate the switch without doing any re-wiring (and also gain connectivity). Preferably a manufacturer who addresses the EU market.</p>
2018-07-03T04:23:13.993
<p>From the <a href="https://nodered.org/docs/creating-nodes/node-js#handling-errors" rel="nofollow noreferrer">documentation</a>:</p> <blockquote> <p>If the error is one that a user of the node may want to handle for themselves, the function should be called with the original message (or an empty message if this is an Input node) as the second argument:</p> <p>node.error(&quot;hit an error&quot;, msg);</p> <p>This will trigger any Catch nodes present on the same tab.</p> </blockquote> <p>So calling <code>node.error()</code> with one argument will not trigger a Catch node.</p>
|node-red|
node-red - node.error does not stop flow sometimes
3138
<p>I think, <code>node.error</code> does not halt the flow in all cases. My aim is to catch errors, save the payload and stop the flow.</p> <p>Please refer the observations and experiments below.</p> <h1>Observation</h1> <p><strong>Function node</strong> - Neither error is caught nor does the flow halt.</p> <p><strong>JSON node</strong> - Error can be caught and flow halts.</p> <p><strong>Postgres node</strong> - Error is not caught but the flow halts.</p> <h1>Experiments</h1> <p>All of the experiments below have Catch nodes to handle errors from all nodes in the flow.</p> <h2>Function node</h2> <p>I added a function node that is wired to an Inject node. The output of this node is a database <code>INSERT</code> query, wired to a <a href="https://www.npmjs.com/package/node-red-contrib-postgres-multi" rel="noreferrer">Postgres node</a>. In the function node, right at the top, I added this <code>node.error('Test error')</code>. While the error can be seen in the console, I can see row inserted into the database. I am not able to catch it either.</p> <h2>JSON node</h2> <p>I wired a JSON node to a MQTT Input node to transform the JSON string payload to a JSON object. This object is passed to a function that generates a <code>INSERT</code> query statement and is wired to a Postgres node. For testing, I passed a malformed JSON document which causes an error in the JSON node. I can catch it and the flow stops too.</p> <h2>Postgres node</h2> <p>With good JSON document, no <code>node.error()</code> statement in function node, the Postgres node inserts successfully. For testing, I created a well-formed JSON document that will raise a <code>duplicate on insert</code> message. In this case, I can see the error message in console. But, I can't catch it.</p> <p>Note that, the Postgres node does raise a <code>node.error()</code>.</p> <h3>Query execution</h3> <p>Refer <a href="https://github.com/BruceFletcher/node-red-contrib-postgres-multi/blob/f6e8758984179e3db8b483ef8843a1648096bf1d/postgres.js#L124" rel="noreferrer">this</a>.</p> <pre><code>try { for (let i=0; i &lt; queries.length; ++i) { const { query, params = {}, output = false } = queries[i]; const result = await client.query(query, params); if (output &amp;&amp; node.output) { outMsg.payload = outMsg.payload.concat(result.rows); } } if (node.output) { node.send(outMsg); } } catch(e) { handleError(e, msg); } finally { client.release(); } </code></pre> <h3>Error handling</h3> <p>Refer <a href="https://github.com/BruceFletcher/node-red-contrib-postgres-multi/blob/f6e8758984179e3db8b483ef8843a1648096bf1d/postgres.js#L109" rel="noreferrer">this</a>.</p> <pre><code>var handleError = (err, msg) =&gt; { node.error(err); console.log(err); console.log(msg.payload); }; </code></pre> <h1>Questions</h1> <p>How can I be sure that any node that raises a <code>node.error()</code> will definitely be caught by a Catch node? Or, in which circumstances, will the Catch node <em>not</em> catch a <code>node.error()</code>?</p>
2018-07-08T10:43:52.297
<p>The NRF51822 is a Bluetooth low energy device, which is mostly chosen for low power applications. It cannot access the internet using Bluetooth (unless your idea is to access the internet using bluetooth or something of that sort). If your application needs internet access, you should be moving to 802.11a/b/g/n or 2G/3G/4G.</p> <p>So if internet access if what you're looking after, you can choose other options like the Noode MCU, ESP8266 or ESP-32. These are WiFi devices can can access the internet using the IP Stack.</p> <p>Here you'll be able to use AWS Free RTOS, ChibiOS and other RTOS based systems with the MQTT library</p>
|aws-iot|aws-greengrass|
Is it possible to implement AWS free RTOS on nrf51822?
3149
<p>Is it possible to implement AWS RTOS on nrf51822? If not what is the alternative solution for connecting nrf51822 to IoT cloud?</p>
2018-07-12T08:51:23.207
<p>255.255.255.0 is the value that determines the <strong>SIZE</strong> of the subnet.</p> <p>192.168.1.xxx with the subnet mask 255.255.255.0 is a subnet spanning from 192.168.1.0 to 192.168.1.255.</p> <p>192.168.10.xxx with the subnet mask 255.255.255.0 is a subnet spanning from 192.168.10.0 to 192.168.10.255.</p> <p>A router is needed for transporting IP from one subnet to another. Ref. <a href="https://en.wikipedia.org/wiki/Router_(computing)" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Router_(computing)</a></p> <p>All devices in the subnet MUST have a unique IP &amp; MAC address!</p> <p>Cisco has a good "IP Addressing and Subnetting for New Users"</p> <p><a href="https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/13788-3.html" rel="nofollow noreferrer">https://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/13788-3.html</a></p>
|networking|wifi|esp8266|communication|arduino|
Could not ping ESP8266 Wifi module connected to an Arduino
3165
<p>I have been working with a water flow counter which sends data over wifi. I'm using an ESP8266 wifi module. Everything is correctly connected and I've gotten to the point where it's correctly connected to the wifi network and everything, except when I try to ping its IP adress from the cmd (192.168.1.125) it times out.</p> <p>I know this info has something to do: I have read it's something about my ipv4 not being in the 192.168... range. But i'm not sure if that's the issue or if so, how to fix it.</p> <p>I should state that the network is my company's and not my home wi-fi so I would not be able to change the network's IP adress (Maybe if it's really necessary I could speak to the network manager). Would the solution be to match the ESP8266's IP adress to the range of that of the network?) (192.192...)</p> <p>ESP2866 Module IP adress: 192.168.1.125 My IPV4 Adress is: 192.192.10.125 Subnet mask: 255.255.255.0 DNS servers: 192.192.10.129 Default gateway: 192.192.10.252</p>
2018-07-13T06:28:34.673
<p>I would really recommend using C and the Arduino library for this since it is much simpler. There is a library for the esp8266 that makes it very easy to use. There is a straightforward connect method and sending data is just like normal socket programming. Let me know if you would be willing to use C and I will post the code. Good Luck!</p> <p>Edit:</p> <p>This is the example code given in the docs for Arduino and esp8266. As you can see it is very straightforward. I have added some comments to explain this a little better.</p> <pre><code>#include &lt;ESP8266WiFi.h&gt; //This is the library I was talking about void setup() { Serial.begin(115200); //Turns on Serial monitor for debugging. Serial.println(); WiFi.begin("network-name", "pass-to-network"); //The "begin" command uses the network name and password to connect to your network. Serial.print("Connecting"); while (WiFi.status() != WL_CONNECTED) //This is just to wait as it connects. { delay(500); Serial.print("."); } Serial.println(); Serial.print("Connected, IP address: "); Serial.println(WiFi.localIP()); //This will print the esp's ip } void loop() { //Add your code here to control the relay. //use digitalWrite(pin,HIGH) to send a 5 volt output to the pin stated. } </code></pre> <p>Let me know if this helps.</p>
|esp8266|
How to work with an ESP8266 with relay?
3172
<p>I bought this <a href="https://www.aliexpress.com/store/product/ESP8266-ESP-01S-5V-WiFi-Relay-Module-Things-Smart-Home-Remote-Control-Switch-for-Arduino-Phone/2130127_32841061942.html?spm=2114.12010608.0.0.5c5e1692F1yhsL" rel="nofollow noreferrer">ESP8266 Relay</a>, and I wish to connect to it (in order to install MicroPython, and use Python code). However, I can't find any way to start working with it.</p> <p>The item is Wi-Fi discoverable, and got connected to. But from here, I couldn't get to its web page to try manage it, as I understand it.</p> <p>I have also asked the seller, but they don't know how to support it.</p> <p><strong>EDIT 1</strong> <a href="https://www.aliexpress.com/item/ESP8266-ESP-01S-5V-WiFi-Relay-Module-Things-Smart-Home-Remote-Control-Switch-for-Arduino-Phone/32841061942.html?spm=2114.search0104.3.1.517434813XJMnZ&amp;ws_ab_test=searchweb0_0,searchweb201602_3_10152_10846_10065_10151_10344_10068_10342_10343_10059_10340_10341_10696_100031_10084_10083_10103_10618_10624_10307_10623_10622_10621_10620,searchweb201603_45,ppcSwitch_5&amp;algo_expid=fcd81a17-a8ed-45d5-b165-2909bf1e3c89-0&amp;algo_pvid=fcd81a17-a8ed-45d5-b165-2909bf1e3c89&amp;priceBeautifyAB=0" rel="nofollow noreferrer">updated link</a></p> <p>** EDIT 2**</p> <p>added pic. <a href="https://i.stack.imgur.com/AEYij.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AEYij.png" alt="snapshot connecting device"></a></p> <p>How can I connect to it in order to use MicroPython?</p>
2018-07-16T04:26:20.000
<p>Try changing this:</p> <pre class="lang-c++ prettyprint-override"><code>#define CONSOLE Serial; </code></pre> <p>To this:</p> <pre class="lang-c++ prettyprint-override"><code>#define CONSOLE Serial </code></pre> <p>Notice the absence of the <code>;</code> character in the change.</p> <hr /> <p>The preprocessor is expanding <code>CONSOLE</code> to <code>Serial;</code>, which results in, for example, <code>Serial;.begin(9600);</code>, which has 2 <code>;</code>s in the statement, the first of which is unwanted.</p>
|arduino|
Arduino Serial Error
3184
<p>I am using Arduino ATmega2560. I have defined Serial as CONSOLE. When I am using CONSOLE it shows me error.</p> <pre class="lang-c++ prettyprint-override"><code>#include &quot;Arduino.h&quot; #define CONSOLE Serial; void setup() { CONSOLE.begin(9600); } void loop() { CONSOLE.println(&quot;Hello&quot;); delay(2000); } </code></pre> <p><a href="https://i.stack.imgur.com/cMQ6H.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cMQ6H.jpg" alt="enter image description here" /></a></p>
2018-07-16T13:16:13.530
<p>This is really an Electrical Engineering question, not an IoT question.</p> <p>What you have discovered is related to the issue of "burden voltage". Essentially, modern meters do not directly read current, but instead place a shunt resistor in the circuit (ie, you properly connected the meter in series) and then measure the voltage drop across this.</p> <p>The challenge is in the selection of the shunt resistor - too small, and low currents cause a voltage drop which may not be as many counts of the measuring ADC as desired, too large and the current drawn to operate the system may drop a voltage large enough that the system cannot operate.</p> <p>With something that draws different amounts of power at different times, the problem gets worse - for example, if you have an MCU that starts up at full clock, then goes to sleep, it may be hard to power it through the meter until the point of sleep, on a current scale where the tiny sleep current can be measured. Digital radio systems have this problem as well, as the radio can draw 10 or more times baseline current, in brief pulses.</p> <ol> <li>Still, it's worth experimenting with different ranges on your meter</li> <li>If your meter is auto ranging, you can use your own shunt resistor, and operate the meter in voltage mode.</li> <li>In some cases, you may want to start up the circuit with a clip lead bypassing the meter, and then once the circuit is believed to be in the low power mode you want to measure, you can remove the clip lead. If you are lucky this works, but you can end up timing it wrong, or causing a voltage drop that triggers a brownout detector.</li> </ol> <p>In a pulsed system, it's often useful to measure over time anyway. I've had some good results using a chosen resistor (depending on need, anywhere from 10-100 ohms) as a shunt, and adding a capacitor to moderate changes. This can then be monitored on an oscilloscope to see how power consumption varies over time.</p> <p>For a more formal study, I've found an INA219 I2C high-side current measurement breakout modified with a larger shunt resistor to be quite useful. It's managed by an Arduino which reads it at a high rate, and logs summary information - peak current, average over time, and integrated over shorter periods of interest. This serial measurement stream then gets merged with debug output from the device being studied, making it possible to see what various operations "cost".</p> <p>In taking these measurements, it's also important to consider that I/O interfaces like serial channels and programmers can contribute or steal current, so these either need to be disconnected or their impact evaluated before a reliable measurement can be made.</p>
|esp8266|power-consumption|
Could not measure power consumption of ESP8266 module
3186
<p>I want to measure the power consumption of ESP8266-01. For that I connected my multi-meter in series with ESP8266 to measure the current but then ESP8266 does not power up and multi-meter gives zero. </p>
2018-07-16T15:40:08.747
<p>Considering the <code>connection</code> line is a required field to start a bridge config <code>remote_clientid</code> will always override, this should be clear from the description of the <code>remote_clientid</code>.</p> <p>It states that the default will be </p> <blockquote> <p>'name.hostname'</p> </blockquote> <p>Where <code>name</code> is the argument given in the <code>connection</code> line.</p> <p>(Also this literally takes 2 mins to test on the command line by starting 2 brokers)</p>
|mqtt|mosquitto|bridge|
mosquitto - bridging options for remote client identifier
3189
<p>From <a href="https://mosquitto.org/man/mosquitto-conf-5.html" rel="nofollow noreferrer">mosquitto.conf</a>, the following options (among many others) exist for bridging.</p> <ul> <li><code>connection</code> <em>name</em> </li> </ul> <blockquote> <p>This variable marks the start of a new bridge connection. It is also used to give the bridge a name which is used as the client id on the remote broker.</p> </blockquote> <ul> <li><code>remote_clientid</code> <em>id</em></li> </ul> <blockquote> <p>Set the client id for this bridge connection. If not defined, this defaults to 'name.hostname', where name is the connection name and hostname is the hostname of this computer.</p> </blockquote> <p>If <strong>both</strong> the configuration options are specified <em>and</em> are different, then which ID applies to the remote broker?</p>
2018-07-21T08:14:15.677
<p>You have edited the wrong <code>settings.js</code> file. The version in the <code>node_modules/node-red</code> directory is the template that gets copied to the User directory when Node-RED is started for the very first time.</p> <p>When Node-RED starts it logs the settings file it is using as follows:</p> <pre><code>21 Jul 13:31:49 - [warn] ------------------------------------------------------ 21 Jul 13:31:49 - [info] Settings file : /home/hardillb/.node-red/settings.js 21 Jul 13:31:49 - [info] User directory : /home/hardillb/.node-red 21 Jul 13:31:49 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable 21 Jul 13:31:49 - [info] Flows file : /home/hardillb/.node-red/flows_tiefighter.json 21 Jul 13:31:49 - [info] Server now running at http://127.0.0.1:1880/ </code></pre>
|monitoring|node-red|nodejs|
node-red - Metrics display with pm2?
3210
<p>The Node-RED <a href="https://nodered.org/docs/user-guide/logging" rel="noreferrer">documentation</a> is clear - set <code>metrics</code> to <code>true</code> to track flow execution and memory usage information. So, I stopped Node-RED with <code>pm2</code>, edited the <code>settings.js</code> file and started Node-RED. But, no metric output is seen in the <code>.pm2/logs/red-out-1.log</code>! The debug nodes in various flows in my application have been configured to output to console and they come correctly.</p> <p>How to view the metrics?</p>
2018-07-24T05:12:27.927
<p>LD33CV quiescent current is 5mA. This is the problem because even in deep sleep mode voltage regulator consumes power.</p>
|esp8266|power-consumption|
NodeMCU connected with batteries stopped working after 2 hours
3218
<p>I connected nodemcu with batteries and uploaded a code which sends http post request every 10 min and goes to deep sleep. But after 2 hours node mcu stops sending the data. Voltage regulator used is LD33V</p> <p>Used AA batteries.</p> <p>Battery level when stopped working was 2.5V.(Do not know why the power consumption was high though we used deepsleep mode).</p> <pre><code>#include &lt;ESP8266WiFi.h&gt; #include &lt;WiFiClientSecure.h&gt; #include &lt;ESP8266HTTPClient.h&gt; long duration, distance; char* ssid = "****"; char* password = "******"; void connectWiFi() { WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { WiFi.begin(ssid, password); delay(5000); } } void setup() { Serial.begin(115200); WiFi.mode(WIFI_STA); connectWiFi(); WiFiClientSecure client; distance = 4; String data = " {\"value\":"+String(distance)+"}"; if(client.connect("********.com",443)){ client.println("POST /****/**** HTTP/1.1"); client.println("Host:********.com"); client.println("Content-Type:application/json"); client.println("x-apikey:******************"); client.print("Content-Length: "); client.println(data.length()); client.println(""); client.println(data); } delay(1000); ESP.deepSleep(600000000); } void loop() { } </code></pre>
2018-07-25T13:44:15.907
<p>The latest actual list of public and free MQTT brokers located <a href="https://github.com/mqtt/mqtt.github.io/wiki/public_brokers" rel="nofollow noreferrer">here</a>. Some of them provides service just for test purposes as <strong>hardillb</strong> mentioned, some of them provide even SLA for free service. Please read careful each broker information page about terms of use, SLA and limitations they provide.</p>
|mqtt|
Free MQTT brokers
3222
<p>Are there any limitations ( mainly amount of messages) when using free MQTT server ( such as iot.eclipse.org ), that causes from time to time not to publish messages?</p> <p>I have 2-3 device connected at home, and for testing purposes, publish about 10-20 a day. </p>
2018-07-28T04:09:28.823
<p>The Sonoff line is very diy-friendly, breaking out the ESP8266 headers you need to program it. Anything Wi-Fi under $10USD/ea commercially will probably be using an ESP8266. They probably won't get a lot cheaper than that, there's just no margin down there. In the DIY market, there's nothing else Wi-Fi and programmable under $5/ea and commonly available. I've heard of a few contenders, an "ESP killer", but nothing has taken off yet. </p> <p>In terms of performance, again, there is not a lot of competition. The ESP32 is a lot faster, and more importantly for IoT, is dual core. This allows you to notify a slow server of a button press without missing a 2nd button press while waiting; if done right, the 2nd press notification will be sent out as soon as the first is done. Speed-wise, the ESP32 compares favorably to boards 2-3 times the cost (under $10USD/ea), and has an alphabet soup of hardware interface support. If you need more that that, you should look into pi-shaped SBCs instead of MCUs.</p> <p>I've seen nodeMCUs connect over a kilometer away, albeit barely. The router position makes a big difference, and I don't think more expensive MCUs will offer any better range, you would be better off getting an ESP8266 with an antenna jack and a large external antenna. You should have no issue with range using one of those. The lag on ESP's http interface is incredibly low, I've turned around packets in 8ms. I get over "five 9s" of uptime long-term, based on my server logs. The Wi-Fi send bandwidth is about 20KB/s, which is plenty for most automation tasks, and the receive is twice as fast. You can get "Wemos pro" boards with 16MB of flash if you need it, but with Wi-Fi built-in, and server storage so cheap, you shouldn't need a whole lot on-board.</p> <p>The main drawback of ESP8266s is the TLS support, as you mentioned. It's slow and the environment is not really designed in a way it can be made much better. The ESP32 is much better about this, and will become much much better soon, when the hardware crypto accelerations are all wired up in the SDK. At any rate, you said you want to keep it local anyway. It's hard to use HTTPS locally anyway, since you don't have a domain and easy to use cert on localhost. Also consider that your Wi-Fi is already encrypted, the security depends on your password's complexity. If someone is on your LAN, you likely have bigger issues than them surreptitiously turning off your lights. </p> <p>In short, at the price points we're talking about here, the ESP8266 is (still) as good as it gets now, and it's a whole lot better than it was a couple years ago. I was secretly hoping lot of people would jump in and recommend something I didn't know about, and maybe down the road we can update this, but if you can't be with one you love, learn to love the one your'e with; it's good enough for the rest of us. For now.</p>
|wifi|arduino|smart-plugs|
Commercial Arduino Reprogrammable Smart Plug
3228
<p>Has anyone reprogrammed a commercially available smart plug, such as the Etekcity Voltson? Are there plugs available with open source Wi-Fi chips in them that perform better than an ESP8266? I’m looking for recommendations on a reprogrammable plug. I want the comms to stay local in my house. I can program it, I just need to find good “open” hardware.</p> <p>I found this Etekcity teardown, <a href="https://fccid.io/2AB22ESWO1-USA/Internal-Photos/Internal-photos-3114486" rel="nofollow noreferrer">ESWO1-USA Etekcity Voltson Smart Wifi Outlet Teardown Internal Photos Etekcity Corporation</a>:</p> <ul> <li><p>Top and underside of Voltson with case removed, and components in place <a href="https://i.stack.imgur.com/4LJQh.jpg" rel="nofollow noreferrer" title="Voltson with case removed">(image)</a></p></li> <li><p>Components removed and underside of RF module <a href="https://i.stack.imgur.com/ktEIK.jpg" rel="nofollow noreferrer" title="Components removed and underside of RF module">(image)</a></p></li> <li><p>RF module <a href="https://i.stack.imgur.com/2RsOJ.jpg" rel="nofollow noreferrer" title="RF module">(image)</a></p></li> </ul> <p>If all the circuits are available, it would be plausible to reprogram or replace the ESP8266EX inside it.</p> <p>This guy does a hack job separating the case, but if he had used plastics tools, it looks like there are clips to snap it back together: <a href="https://m.youtube.com/watch?v=5UTWIupIKkk" rel="nofollow noreferrer">YouTube - Etekcity Wifi Smart Plug Teardown</a>.</p> <p>Until I hear something better is available for my purpose, I will give this a shot.</p>
2018-08-01T13:19:41.563
<p>A better approach is to get a broadband router that will fall back to using a 3G/4G USB stick if the broadband line goes down.</p> <p>This means any devices (such as your Nest cam) doesn't need to know about 2 different networks, the router handles all that for all devices.</p> <p>There are plenty of these on the market as it's a standard fall back for small businesses that don't want to install a back up second line.</p>
|wifi|digital-cameras|surveillance-cameras|nest-cam|
Nest cam fallback wifi
3235
<p>If wifi that my Nest camera is connected to goes down, can it reconnect to an alternative wifi? In other words if the "thieves" cut the broadband cable, but I still have a 4G router as a backup, would it work?</p>
2018-08-01T14:44:58.433
<p>It was a port issue on my network.</p> <p>I found a Reddit post which mentioned UPnP and having Port 80 available on the router.</p> <p>I have a Windows Home Server running on my network which opens up Port 80 via UPnP for some of it's services.</p> <p>I disabled those services but still couldn't connect via the App or Labs</p> <p>I restarted the Bridge and can now connect.</p> <p>So, the answer is - make sure the Bridge can get port 80 on your router.</p> <p><strong>EDIT:</strong> I have since re-enabled the Windows Home Server services and both are now playing nicely together!</p>
|philips-hue|
Philips Hue Out of home control won't log in
3236
<p>I have some Philips Hue bulbs and a Bridge set up in my house.</p> <p>When I am at home the Philips Hue App can connect to and control everything.</p> <p>However, when I am away from home (or simulate such by turning off WiFi on my phone) the App is unable to connect.</p> <p>The <code>Out of home control</code> section in Settings shows <code>Not logged in</code></p> <p>I tap it, then the <code>Log in</code> button and a browser window opens connecting to api.meethue.com then redirects to account.meethue.com</p> <p>I sign in to the browser page and am asked to grant permission to the App and I click yes</p> <p>The <code>Out of home control</code> section then says <code>Logging in...</code> in orange and a red notification appears saying <code>Unable to connect</code></p> <p>Eventually, another alert pops up saying <code>Can't log in to My Hue because the Hue Bridge is offline. Make sure the Hue Bridge is connected to the internet.</code></p> <p>Then the <code>Out of home control</code> section reverts to <code>Not logged in</code></p> <p>The Bridge is definitely connected to the internet - all 3 of the blue LEDs are lit.</p> <p>What am I doing wrong? </p> <p><strong>EDIT:</strong> I have the same problem on my iPad and on the Hue Labs website</p>
2018-08-01T18:49:08.810
<p>It turns out that the Chromecast uses a fairly common method of getting Wi-Fi details—it <a href="https://superuser.com/q/626199/655923">acts as a Wi-Fi access point</a> when turned on. The apps wrap the setup process up neatly, but essentially the process is this:</p> <ul> <li><p>The Chromecast boots into access point mode if it doesn't have any Wi-Fi details stored.</p></li> <li><p>The apps look for this access point—this is presumably why they insist on you installing an app (or using the feature built into Chrome), because a website cannot connect to other Wi-Fi networks, but a native app can usually do that.</p></li> <li><p>Once the access point is found, the app will handle sending the connection details to the Chromecast.</p></li> <li><p>The Chromecast will then switch off its access point and try to connect to the network.</p></li> </ul> <p>This isn't an unusual method (and similar products might just have you directly connect to the network from your phone/computer, loading up a landing page). All that's different in this case is that the app handles the steps for you.</p>
|security|wifi|
How to configure Wifi on a headless smart device?
3241
<p>I am looking to build a smart device with no external controls (no buttons, display, etc.) and am trying to figure out how to most easily allow a user to supply Wifi configuration to it.</p> <p>A specific device that comes to mind is the Chromecast; to configure this device, a user simply goes to a URL (something like <code>chromecast.com/setup</code>) and is able to configure the device from there. How is something like that implemented on a technical level? The site must redirect to a local I.P. or something, but that wouldn't make sense because there is no guarantee that the device has any specific I.P.</p> <p>In short, I am looking for a description of how such a feature on something like the Chromecast is implemented. </p>
2018-08-02T15:58:45.723
<p>While Bence is correct, you have also asked </p> <blockquote> <p>I have been reading device documents to find out where the data I want to collect is stored in registers, but I never felt like I understood the location decisions that were being made to create the Modbus servers</p> </blockquote> <p>The only way to find where the data is located in the registers is through the documentation provided with the device.</p> <p>Now talking about the decision, about where to place which data, consider the following example,</p> <p>You have a temperature controller which provides you with the following data, 1. On/Off status 2. Temp Set Point 3. Actual Temp (typically called process value)</p> <p>Then,</p> <p><strong>On/Off Status:</strong> If you want to allow external device/software to turn the device on/off then you would place it inside coils else if you just want to inform the users about the on/off status then you would place it in contacts making it read only thus restricting external control.</p> <p><strong>Set Point</strong> Typically you would want an operator to change the set point and this value would need more than a bit so this would be placed in a holding register so you can read and write into it.</p> <p><strong>Actual Temp</strong> this is something which is always read-only as you are reporting the actual sensed temperature and so should be placed in an input register.</p> <p>If you want to integrate MODBUS communication into your software try NMODBUS which is a free MODBUS library and has worked great for me.</p> <p><a href="https://github.com/NModbus/NModbus" rel="noreferrer">https://github.com/NModbus/NModbus</a></p> <p>Hope that helps. </p>
|protocols|
What are the differences between Modbus addressing zones?
3246
<p>I am trying to implement a control software (client) that communicates with a number of distributed devices (servers) over Modbus. I have been reading device documents to find out where the data I want to collect is stored in registers, but I never felt like I understood the location decisions that were being made to create the Modbus servers.</p> <p>What kinds of data is typically stored in each of the addressing zones? What is a <code>Coil</code>?</p> <p>Taken from <a href="http://www.simplymodbus.ca/FAQ.htm" rel="noreferrer">http://www.simplymodbus.ca/FAQ.htm</a>: <a href="https://i.stack.imgur.com/U8SmL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U8SmL.png" alt=""></a></p>
2018-08-06T14:54:22.950
<p>Public keys by definition are public (no need to keep them secret).</p> <p>So there is no reason it can't be available for download via http or at a push published as a retained message on a known MQTT topic.</p>
|mqtt|cryptography|
mqtt publish/subscribe key exchange?
3262
<p>I'm realy a newbie in cryptography, I want to do MQTT payload encryption with AES, i've done it with PyCrypto library, but i'm still wondering how I can encrypt AES key before sending it to the subscriber, so i choose Python library called PyNacl to do that with ECC (curve25519), but i have no idea how to exchange the public key between the publisher and subscriber, have you any idea to do that ?</p>
2018-08-07T06:22:59.513
<p>I think what you mean to say is, the on field M2M communication protocols are not standardised for e.g, some devices use zigbee, some use zwave some use ble etc.</p> <p>So in a premises when you have multiple devices from multiple vendors all implementing different protocols like the ones mentioned above, it becomes a problem to fetch the data from all these devices as you need a middle layer/device which would support all these different protocols fetch the data and push it forward. So there is no single communication protocol used by all manufacturers. This is what people mean typically when they say there is no standardization of protocols for IOT.</p> <p>Protocols like MQTT and CoAP are typically used for exchange of data between a field gateway and a remote server (like the azure iot hub).</p> <p>Hope it made sense.</p>
|standards|
What does it exactly mean to say the IoT Protocols are not standardized?
3266
<p>It is said that there is no standard for IoT Protocol Communication. What does it mean to say that?</p>
2018-08-12T04:20:28.047
<p>You can find what you need at the bottom of the aforementioned link.</p> <p>Further to this, my advice is that the schematic shows that, apart from the relay, button and LED GPIOs, (which you probably should not play with, since they already have functions), the Rx and Tx pins (clearly labelled on your board) are also GPIO pins. You can solder another header on there. I don't know what software "your own" is but firmware like TASMOTA, for example, allows these pins to be reconfigured for whatever function you wish: they can take on the functions of GPIO4 and GPIO14 on other style boards, or even be used as I2C.</p> <p>You should take confidence from the fact that I have used these schematics to add 2.5mm jacks to Sonoff Basics. Be sure to check against the version number on your board. There are instructions out there on how to modify a TH, but I think it's a really old board.</p>
|esp8266|gpio|
Sonoff Dual - Where to find GPIOs
3276
<p>I'm looking for the GPIO's I can use in SonOff Dual ( after flashing my own software ). In SonOff Basic - there are GPIOs to acess LED, Relay, and what is most needed for me - GPIO14 for external input <a href="https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-Basic" rel="noreferrer">as shown here</a></p> <p>Since I need 2 Relays solution, I need 2 external inputs. I'll be happy to get some assistance in finding those "free GPIOs"</p>
2018-08-15T08:38:57.537
<p>This is a very generic question, the answers mainly depend on your existing skills, and if you desire to progress into developments that might be commercially relevant. Depending how far you want to plan your learning ahead, you might want to start simple, and upgrade the architecture/implementation as you go along.</p> <h2>Platform</h2> <p>An SBC (Pi or similar) is great if your want to focus on high level software. <a href="https://iot.stackexchange.com/questions/1425">This question</a> addresses some of the reasons that working with an SBC and an MCU present different experiences. An SBC is rather power hungry and might not come with built in short range connectivity. </p> <p>There are small mcu boards with either WiFi or BLE built in, these are much better suited for battery powered operation. MCU boards can be coded in python, the micro:bit has bluetooth and supports <a href="http://microbit-micropython.readthedocs.io/en/latest/" rel="nofollow noreferrer">micropython</a> (but might not be well optimised for ultra-low power if you use it like this).</p> <p>If you care about making a secure platform (now or in the future) then you might also care about having secure on-chip memory, good entropy sources, etc.</p> <h2>Architecture</h2> <p>The 'many nodes, one hub/gateway' approach is good for battery powered devices. You can have an array of battery powered/short range devices (mesh or otherwise), communicating with a central SBC device. The SBC handles your WAN/cloud interface and also some stand-alone features if necessary.</p> <p>If you make each node a peer (with wifi/WAN access) then you only need to write one software stack, but it's more complex, and you end up being reliant on LAN for any communications - so power outage operation isn't possible.</p> <p>To clarify the types of devices:</p> <p><strong>SBC</strong> Single Board Computer, the Raspberry Pi is the most common. These can run linux, and might also be a NAS, a WiFi router, smart home device or a mobile phone/tablet which is running a bit of software to handle the automation task.</p> <p><strong>MCU</strong> A much wider class of device, not necessarily significantly lower in processing capability, but more likely to run a real-time OS, and more likely to use event driven programming. There are lots of small eval boards, WiFi or Bluetooth modules with some spare cycles, and dedicated small form factor boards like the <a href="https://www.pjrc.com/teensy/" rel="nofollow noreferrer">teensy</a> series. An MCU might be better to interface to certain types of sensor, and will often have a wide range of interfaces available (even displays).</p>
|raspberry-pi|aws-iot|arduino|
First steps to learn IoT with watering plants project
3284
<p>I am an experienced developper, and I want to learn IoT beginning with a small project. Automatic Watering the plants of my house.</p> <p>Here are the requirements:</p> <ul> <li>The project is for learning purpose</li> <li>It must be simple</li> <li>It should be easily scalable ( if I want to buy a new plant, I should just buy a new sensor )</li> <li>Right now, I think I only care about Moisture data</li> <li>When the moisture level is too low, it pumps water into the plant</li> <li>The installation should be discrete. I love plants, and wouldnt like to convert them into a big technological visible installation</li> <li>I would like to code with Python, or JS. I wouldn't like to code with C or C++ if possible.</li> <li>I am efficient on AWS, so I would like to use AWS IoT if it brings me something valuable.</li> <li>Easy learning curve if possible</li> <li>Optional - Mobile Dashboard - I saw <a href="https://www.blynk.cc/" rel="nofollow noreferrer">blynk</a>, I should maybe use it, but this part is more the one I know, so it should not be so difficult.</li> </ul> <p>Should I use Arduino or RasperryPi ?</p> <p>What kind of architecture should I use ?</p> <p>Or basically, any idea of what should I read, where should I start?</p>
2018-08-16T14:39:50.247
<p>The decision should be made based on how are you using topics. If you need values together - post them into one topic, if you are using separately - put them into separate topics. Also do not post values, like in your first sample, in the topics. And do not create exceed topics, like sensorX/temperature for temperature sensors, go from more general in the beginning to more specific in the end. So I would recommend you to post into:</p> <pre><code>plant1/machineA/sensorX { "value": 20, "unit": "C", "timestamp": "2018-08-01T12:00:30.123Z" } </code></pre> <p>or if you have various types of sensors and want to select between them put temperature somewhere before sensor name:</p> <pre><code>plant1/machineA/temperature/sensorX </code></pre> <p>or also possible case is:</p> <pre><code>temperature/plant1/machineA/sensorX </code></pre>
|mqtt|publish-subscriber|
MQTT multiple topics vs. bigger payload
3293
<p>I am wondering about best practices of topic naming and payload design of mqtt messages. </p> <p>Is it better to have multiple and long topic names instead and a bigger payload or short topic name with bigger payload. </p> <p>For example: </p> <pre><code>plant1/machineA/sensorX/temperature/value 20 plant1/machineA/sensorX/temperature/unit C plant1/machineA/sensorX/temperature/timestamp 2018-08-01T12:00:30.123Z </code></pre> <p>vs.</p> <pre><code>plant1/machineA/ { ["sensorX": { "value": 20, "unit": "C", "timestamp": "2018-08-01T12:00:30.123Z" }] } </code></pre> <p>There are a lot more possibilities. But is there a general approach? As much as possible in topic name or in payload? </p>
2018-08-18T20:39:40.383
<blockquote> <p>I heard that MQTT is perfect for when we are restricted in bandwidth, but does that make it slower?</p> </blockquote> <p>No, if anything the opposite. The fewer bytes you have to send the shorter the time for the total message to arrive at its destination for a fixed rate of transfer.</p> <p>MQTT is said to have a low overhead, this means that it sends a very small amount of extra data as well as the actual content of the message you want to send. E.g. when the header can be incredibly small when compared to something like HTTP which has a very verbose text header including things like <code>User-Agent</code> and <code>etag</code> where as the MQTT packet header just includes the topic, message size and some bit flags for QOS and Retained state, apart from the topic all of this information is encoded in the smallest possible binary form.</p> <p>The original use case for MQTT was to send data back from an oil pipeline over a satellite network connection, the price was very high to send each byte of information.</p>
|mqtt|
What is the difference between bandwidth consumption and speed of IoT protocols?
3299
<p>If IoT protocol has small bandwidth consumption, does that mean its speed is slower? </p> <p>I heard that MQTT is perfect for when we are restricted in bandwidth, but does that make it slower? </p>
2018-08-23T14:49:53.723
<p>There is also a company called "Allterco Robotics". They introduced the "Shelly". This is a very small piece of ESP8266 Hardware and some open source software.</p> <p>You can place them behind your existing plugs and control your plugs via WiFi afterwards.</p> <p><a href="https://shelly.cloud/shelly1-open-source/" rel="noreferrer">https://shelly.cloud/shelly1-open-source/</a></p>
|smart-home|smart-plugs|
Do integrated smart plug sockets exist?
3309
<p>I've seen a lot of Smart Plugs for sale online like the ones below. </p> <p>The next logical step to me seems to have integrated plug sockets in the wall as the smart plugs are quite bulky. But I can't for the life of me find any... </p> <p>Do they exist? If so, where? If not, why?</p> <p><a href="https://i.stack.imgur.com/xMI6o.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/xMI6o.jpg" alt="Smart plug array"></a></p>
2018-08-25T11:30:47.153
<p>The concept of middleware is a little ambiguous. You mean a middleware between your backend and raspberry/ies?</p> <p>A middleware is useful when you have different devices and protocols communicating to your backend. Its job is to handle communication in a easier way without having you to worry about which device is using which protocol. However it adds complexity to your system (communication errors handling, deployment, scalability and so on). </p> <p>In your case if you have one raspberry or many of them (since raspberry is communicating the data to the backend, Arduinos here should not even considered) communicating the same kind of data and you think your system will not change much then no, I think you will not need it.</p> <p>If you think in the future your system will have to interface with many protocols (<code>http</code>, <code>MQTT</code> and other protocols) and in different ways then yes a middleware might be needed.</p>
|raspberry-pi|arduino|
IoT and middleware
3317
<p>We are building a solution as described below:</p> <ol> <li>Arduino-based sensors read data and send it to Raspberry every second.</li> <li>Raspberry Pi processes these data and then communicates with a backend system using an exposed Web Service every minute.</li> <li>the solution is in an industrial environment.</li> </ol> <p>My Questions:</p> <ol> <li>Do I need middleware for this job? </li> <li>If the answer is yes, can I use a Raspberry for this or better use a server/VM for this purpose?</li> <li>Any middleware recommended?</li> </ol>
2018-08-25T19:14:22.070
<p>With a malfunctioning system, you want to connect in a way that does not depend on networking. MT7688 systems including the Onion Omega have logic-level serial consoles. </p> <p>The "Expansion Dock" should already have a USB serial function on it, if not you'll need to get a 3.3v logic level USB serial converter.</p> <p>You'll have to see the onion docs to determine which pins have the serial interface and what the baud rate is, if I recall it is on a different port than is typical for MT7688's (though that's only relevant after looking up the physical module pinout) and may be 57600 baud vs the 115200 used by most other MT7688 systems. If using the USB serial on the dock, you should only need to worry about the baud rate.</p> <p>There is also a button-based mechanism for doing a factory reset, though that would not work in the case of corruption of the flash partitions that user operations do not normally touch, such as might result from an incomplete firmware update.</p> <p>Generally speaking you'd do better pursuing this on the Onion community site. While the company itself has a rather poor record (see the many issues documented on that site), there is a fair amount of community support there.</p>
|onion-omega2|
Can't connect to Onion Omega 2
3325
<p>I have an Onion Omega 2 which I haven't used for a year or more and would like to use for an IoT project.</p> <p>I have attached it to the Expansion Dock, and connected it to my laptop with a USB cable.</p> <p>Four white LEDs flicker constantly, but I don't see the Omega on my laptop's list of WiFi devices. Nor can I discover it with Bonjour.</p> <p>Having looked through the troubleshooting docs, I decided to follow the instructions at</p> <p><a href="https://docs.onion.io/omega2-docs/connecting-to-the-omega-terminal.html#connecting-to-ssh-windows" rel="nofollow noreferrer">https://docs.onion.io/omega2-docs/connecting-to-the-omega-terminal.html#connecting-to-ssh-windows</a></p> <p>However, when I try to use Putty to connect to <code>omega-ABCD.local</code> where <code>ABCD</code> are the last digits of the Omega's MAC address, using port 22, Putty says that it can't connect because the "Host does not exist".</p> <p>Any ideas how I can connect?</p>
2018-08-28T20:17:17.337
<p>Sonos supports <a href="https://www.sonos.com/en-gb/airplay" rel="nofollow noreferrer">Airplay</a> so you should be able to just steam audio from the phone to the to that and have it feed into your existing system.</p>
|audio|
Using an iPhone as a source for a whole home audio system
3336
<p>Not sure this is the correct StackExchange site, but I have a whole home audio system in my home. I have 2 Sonos units connected to it as sources, and they work fine. Is there a way to use my iPhone as a remote source for a whole home setup? Can't be bluetooth, and it would have to be a solution where I can remotely use my phone (on the same network is fine), but whatever is playing on my phone can be input to the preamp as a source.</p> <p>I am thinking maybe there is some device you can buy that will "listen" to your phone and send the signal into the preamp?</p>
2018-08-31T11:33:13.637
<p>Two things:</p> <ol> <li>The <code>+</code> as a wild card for subscription is <strong>NOT</strong> honored. From the <a href="https://docs.aws.amazon.com/iot/latest/developerguide/pub-sub-policy.html" rel="nofollow noreferrer">documentation</a>:</li> </ol> <blockquote> <p>The MQTT wildcard character '+' is not treated as a wildcard within a policy. Attempts to subscribe to topic filters that match the pattern foo/+/bar like foo/baz/bar or foo/goo/bar fails and causes the client to disconnect.</p> </blockquote> <ol start="2"> <li>The topic string shouldn't have the leading the leading slash.</li> </ol> <p>Therefore, I changed the policy to have the exact topic string and in my pub and sub clients removed the leading slash. It works now.</p> <p>:roll-eyes:</p>
|mqtt|mosquitto|aws|
aws iot - mosquitto_sub does not subscribe
3345
<p>This is my policy document:</p> <pre><code>{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iot:Connect", "Resource": [ "arn:aws:iot:us-east-2:000000000000:client/sub", "arn:aws:iot:us-east-2:000000000000:client/pub" ] }, { "Effect": "Allow", "Action": "iot:Subscribe", "Resource": "arn:aws:iot:us-east-2:000000000000:topicfilter/org/cid/+/data" }, { "Effect": "Allow", "Action": "iot:Publish", "Resource": "arn:aws:iot:us-east-2:000000000000:topic/org/cid/sample/data" }, { "Effect": "Allow", "Action": "iot:Receive", "Resource": "arn:aws:iot:us-east-2:000000000000:topic/org/cid/sample/data" } ] } </code></pre> <p>This is my publishing client:</p> <pre><code>mosquitto_pub -h endpoint-ats.iot.us-east-2.amazonaws.com -p 8883 -i pub --cafile aws-iot-root-ca-1.pem --cert pub-certificate.pem.crt --key pub-private.pem.key -t /org/cid/sample/data -m 'Hello' </code></pre> <p>And, this is my subscribing client:</p> <pre><code>mosquitto_sub -h endpoint-ats.iot.us-east-2.amazonaws.com -p 8883 -i sub --cafile aws-iot-root-ca-1.pem --cert sub-certificate.pem.crt --key sub-private.pem.key -t /org/cid/+/data -d </code></pre> <p>The subscription never goes through; it keeps reconnecting.</p> <pre><code>Client sub sending CONNECT Client sub received CONNACK Client sub sending SUBSCRIBE (Mid: 1, Topic: /org/cid/+/data, QoS: 0) Client sub sending CONNECT </code></pre> <p>The certificate is attached to the policy correctly.</p> <p>Is there an option to define publish/subscribe settings per client identifier? What am I missing?</p>
2018-08-31T12:55:16.153
<p>Given that Linux devices do process scheduling, the application in Android Things is not going to be able to reliably check the signal coming from a 433 MHz radio directly. It just isn't able to check at 433 million times each second.</p> <p>But you can probably at some radio components to your receiver before it goes into your Android Things board, like an <a href="https://en.wikipedia.org/wiki/Envelope_detector" rel="nofollow noreferrer">envelope detector</a>, so that you can demodulate it to an extent and get a better digital input.</p>
|raspberry-pi|android-things|
Can I use Android Things to detect a doorbell press via an RF Transmitter/Receiver pair?
3346
<p>I've bought a pair of <a href="https://www.ebay.co.uk/itm/4X-433Mhz-RF-Transmitter-and-Receiver-Module-link-kit-for-Arduino-L7O5/112901031330?_trkparms=aid%3D111001%26algo%3DREC.SEED%26ao%3D1%26asc%3D20160727114228%26meid%3De45712766a704ac399f52bbc16120afd%26pid%3D100290%26rk%3D1%26rkt%3D4%26sd%3D112901031330%26itm%3D112901031330&amp;_trksid=p2060778.c100290.m3507" rel="noreferrer">433MHz RF Tx Rx modules</a>. </p> <p>I've been struggling to find any information on getting them working on Android Things (Raspberry Pi).</p> <p>My goal is to set up AT to detect the RF transmission upon a doorbell press and then notify my phone if i'm not in. I'm an Android dev so the software side doesn't phase me, but I'm new to IoT so any and all advice is more than welcome.</p>
2018-09-04T14:06:52.833
<p>Installing latest version,<a href="https://www.home-assistant.io/docs/installation/hassbian/" rel="nofollow noreferrer">version 1.4</a> , solved it. </p>
|smart-home|raspberry-pi|
Home Assistant on Raspberry Pi Zero W
3355
<p>I tried to install Home Assistant on a Raspberry Pi Zero W, following this <a href="https://www.home-assistant.io/blog/2017/05/01/home-assistant-on-raspberry-pi-zero-in-30-minutes/" rel="nofollow noreferrer">blog post</a>. I followed all steps, including starting the daemon as needed. WiFi is connected, and accessible via ‘ssh’</p> <p>After 30 minutes, verified using ‘htop’ that update process has ended, I tried to connect using another PC - with no luck. </p> <p>Can someone tell if additional processes are needed in order to run it?</p> <blockquote> <p>EDIT1:</p> </blockquote> <pre><code>pi@hassbian:/home/homeassistant $ sudo systemctl status home-assistant@homeassistant.service ● home-assistant@homeassistant.service - Home Assistant for homeassistant Loaded: loaded (/etc/systemd/system/home-assistant@homeassistant.service; enabled) Active: failed (Result: exit-code) since Mon 2018-09-03 20:45:07 UTC; 17h ago Process: 631 ExecStart=/srv/homeassistant/bin/hass (code=exited, status=203/EXEC) Main PID: 631 (code=exited, status=203/EXEC) Sep 03 20:45:07 hassbian systemd[1]: Started Home Assistant for homeassistant. Sep 03 20:45:07 hassbian systemd[1]: home-assistant@homeassistant.service: main process exited, code=exited, status=203/EXEC Sep 03 20:45:07 hassbian systemd[1]: Unit home-assistant@homeassistant.service entered failed state. pi@hassbian:/home/homeassistant $ </code></pre> <blockquote> <p>EDIT2:</p> </blockquote> <pre><code>pi@hassbian:/home/homeassistant $ sudo journalctl -u install_homeassistant.service -- Logs begin at Mon 2018-09-03 20:44:51 UTC, end at Tue 2018-09-04 17:14:54 UTC. -- </code></pre> <blockquote> <p>EDIT 3: new install of <a href="https://www.home-assistant.io/docs/installation/hassbian/" rel="nofollow noreferrer">version 1.4</a> first link referred to v1.3 ( as noted in post that suites to RPI zero ). After installing up-to-date software (v1.4), system is operting as needed.</p> </blockquote>
2018-09-08T22:18:31.607
<p>Yes, any modern IoT endpoint software stack will support what you're looking for. I'm not sure that 'signed' is the most accurate way to describe this, but encrypted messaging is a basic requirement. The messaging encryption is likely to use TLS, but you need at least to ensure:</p> <ul> <li>Firmware is 'trusted'</li> <li>Over the Air firmware updates are possible, and trusted</li> <li>Firmware can't be rolled-back to an earlier version</li> <li>Devices have secure certificate stores</li> <li>Device certificates can be blacklisted if individual devices become suspect</li> <li>Devices only connect to trusted servers</li> </ul> <p>Finally, if you need to ask these questions, you really need to find a supplier who you can trust rather than trying to <a href="https://iot.stackexchange.com/questions/1517">roll your own</a>. Unless the whole stack is reasonably secure, you're pretty much wasting your own time by adding a token partial solution.</p>
|security|sensors|cryptography|
Possibility of integrating secure elements with sensor networks?
3377
<p>Assume we need to do a type of digital signature such as ECDSA with sensors used in sensor networks. So, is there a secure and possible approach to store the keys in these sensors? </p> <p>For example, is it possible to integrate a secure element with these sensors to perform securely digital signature? Or maybe there is a better approach to do this?</p> <p>Meanwhile, do we have energy problem for generating signatures? (Regarding to energy limitation of sensors.) </p> <p>In general, is it logical to generate signatures with sensors? (Assume we need signing messages by sensors, because of security issues.)</p>
2018-09-11T05:53:06.317
<p>You need to look at the Node-RED Admin <a href="https://nodered.org/docs/api/admin/" rel="nofollow noreferrer">API</a>, this will allow you to retrieve the current flow, you can then manipulate it and push an updated version back to the runtime.</p> <p>Flows are represented as JSON objects that have entries for each node on the canvas and the links between them.</p> <p>The best place to get help with the API will be on the Node-RED forum or Slack team. Both are linked to from the Node-RED homepage.</p>
|mqtt|node-red|deployment|
node-red - Replicating message flows per MQTT subscribing client
3388
<p>I want a MQTT subscription client to consume messages from AWS IoT broker. On AWS IoT broker, wild card topic subscription is <a href="https://iot.stackexchange.com/a/3352/185">not supported</a>. In our use case, we know the upper bound of number of possible subscriptions. We also know, when a device is set-up to deliver publications. Finally, the processing for every subscription is exactly the same. I have a message flow that is well tested for processing the data published from <em>one</em> device. </p> <ol> <li>Is there a programmatic way to deploy that flow as a new flow with only the MQTT Input node configured for a specific topic string?</li> <li>Conversely, is there a way to "un-deploy" a particular copy of flow for a particular topic string in cases where device maybe decommissioned?</li> </ol>
2018-09-13T05:39:39.547
<p>To publish a message you should try like this: </p> <pre><code>mosquitto_pub -h localhost -t YourTopic -m "Your message" </code></pre> <p>Now if you want to see that message you should try like this: </p> <pre><code>mosquitto_sub -h localhost -t YourTopic </code></pre> <p>Please note in some circumstances you cannot see a published message: </p> <ol> <li>Your broker is not installed properly</li> <li>Your broker is installed on a device, and also your subscriber and publisher devices are different devices. In that case you should make sure all the devices are connected to the same network and all of them can listen each other without firewall interfering (try pinging all devices from each other). </li> </ol>
|mqtt|mosquitto|
View the messages sent to the local Mosquitto server
3397
<p>How can I see the messages that are published to the Mosquitto broker which has been locally installed in Ubuntu? </p> <p>I have used Spring Integration and think it worked fine. I also tried commands in the Command Prompt after searching on the Internet to view the published data in broker.</p>
2018-09-14T13:05:44.017
<p>Yes, it is perfectly possible that a domestic 'smart' installation will struggle to break even in term of saved energy - even though that isn't quite the question you asked.</p> <p>The RF side is fairly efficient, depending on the protocol. A receiver can be fairly low power (finger in the air of sub 1 Watt), and even if the transmit side is 5 watts, the duty cycle is very low. The trick is that maybe you end up adding these to every bulb (which was 3-5 W initially), so your lighting has become ~20% less efficient. Actually, it's far worse because the lighting would only be on for a few hours, but the overhead is on 24/7. So you've potentially halved your efficiency.</p> <p>Taking a step back, the resting load of your house is probably in the order of 100-200 W (assuming you're not wasteful, and not an agressive optimiser). In that context, adding a handful of extra devices won't burn a lot of power (compared to taking a shower or an extra round of hot drinks each day).</p> <p>Where you can save is <em>if</em> you can make use of the smarts to improve your space heating or water heating (maybe also with follow-me lighting if you're otherwise missing this). Your big loads only need a small optimisation to gain back a worthwhile amount of energy - it takes some effort to determine that the house is empty and doesn't need heating, but you'll easily justify leaving the router on 24/7 to achieve this.</p>
|smart-home|power-consumption|
How relevant is the energy consumption of IoT and RF home devices?
3410
<p>I am designing and building my own house. I am very interested in automatizing several devices as blinders and lights.</p> <p>In general, I am thinking in using Zigbee (Xiaomi and Aqara), RF and IR devices. The latter two will be controlled by a RF + IR controller.</p> <p>Each device itself won't probably consume too much. However, imagine all my switches are connected and my blinders are always waiting for an RF signal to activate them. All those devices needs then to work with DC, which makes them, at least, need the use of an AC/DC converter.</p> <p>How much could this devices consume? Is it relevant? Should I worry about it and try to reduce or optimize the number of connected devices?</p>
2018-09-15T09:39:20.863
<p>The error implies that the file you are trying to run (<code>/Users/jampez77/Downloads/android-things-setup-utility/android-things-setup-utility-macos</code>) is just not where you've said it is.</p> <p>Rather than trying to run it from a long path, which introduces more chance of a typo, try running it from the directory e.g.</p> <pre><code>cd ~/Downloads/android-things-setup-utility/ sudo ./android-things-setup-utility-macos </code></pre> <p>Also check that directory is still there and that actual command has the execute bit set.</p>
|android-things|
Command not found while trying to flash Android Things
3413
<p>I'm having trouble installing Android Things on an SD card. The card itself seems fine, it's recognised by my Macbook Pro. I'm using the same command i used for the last pi I set up.</p> <p>Below is the command and the response I'm getting back. </p> <p>I'm pretty new to Android Things but this command worked like a charm last time and nothing has changed AFAIK so no idea where to go from here. </p> <pre><code>Jamies-MBP:ic-self-help jampez77$ sudo ~/Downloads/android-things-setup-utility/android-things-setup-utility-macos Password: sudo: /Users/jampez77/Downloads/android-things-setup-utility/android-things-setup-utility-macos: command not found </code></pre>
2018-09-23T06:20:39.307
<p>Generally speaking, in such case one would simply use a relay. A relay is exactly a &quot;smart plug&quot; without the smart part, basically a relay is a simple device that will flip a switch based on a command, that command can be simply to put a certain voltage to it's pin (most likely 3.3V or 5V when it comes to IOT). The command can also be via I2C, for instance with this <a href="https://uk.rs-online.com/web/p/power-motor-robotics-development-tools/1845099/?relevancy-data=7365617263685F636173636164655F6F726465723D31267365617263685F696E746572666163655F6E616D653D4931384E525353746F636B4E756D626572267365617263685F6C616E67756167655F757365643D656E267365617263685F6D617463685F6D6F64653D6D61746368616C6C267365617263685F7061747465726E5F6D6174636865643D5E2828282872737C5253295B205D3F293F285C647B337D5B5C2D5C735D3F5C647B332C347D5B705061415D3F29297C283235285C647B387D7C5C647B317D5C2D5C647B377D29292924267365617263685F7061747465726E5F6F726465723D31267365617263685F73745F6E6F726D616C697365643D59267365617263685F726573706F6E73655F616374696F6E3D267365617263685F747970653D52535F53544F434B5F4E554D424552267365617263685F77696C645F63617264696E675F6D6F64653D4E4F4E45267365617263685F6B6579776F72643D3138342D35303939267365617263685F6B6579776F72645F6170703D31383435303939267365617263685F636F6E6669673D3026&amp;searchHistory=%7B%22enabled%22%3Atrue%7D" rel="nofollow noreferrer">relay</a> you will have to use I2C to explain to the relay board which switch you want to flip.</p> <p>So one would basically connect a relay to a Micro Controller Unit (MCU) with the necessary connectivity to receive the command and pass them to the relay.</p> <p>I assume that you are also going to use some sensor and this kind of things.</p> <p>There's two approach, either you buy each individual &quot;smart&quot; stuff ie sensors relays and so on which will include in each of them a MCU + one feature (for instance relays or sensor or electrovalve or whatever).</p> <p>Or the most commonly use approach at least in R&amp;D is to drive down the cost by using one or several MCU as needed (for instance ESP32 family) and using them as the base board for the sensors and relays and so on, you would use them to get data from the sensor using and switching outputs such as relays or electrovalves.</p> <p>If for some reason you would be requiring more that one MCU then we would go with a &quot;gateway&quot; that will act as the brain of the operation. And that gateway board would control your slaves, and all your requests would go through it and the slaves will go through the gateway to get to you.</p> <p>Usually this gateway board use a slightly bigger and easier to use processor for instance something running able to run Linux as IMX6, IMX8 or raspberry pi or something like that with the proper connectivity and servers one would need. You will choose this board for instance based on you criteria of connectivity, do you need ethernet? Bluetooth? Wifi? RF? GSM? Sigfox? RF? And then it's capacity to run what you will need it to run such as a REST Api, MQTT server, Socket server and so on.</p>
|smart-plugs|rest-api|
Are there any smart electrical plugs with an open API?
3437
<p>My friend and I are in a university and we have been asked by the agriculture professor to create automated watering systems for plants. We want to have control over the grow lights so are there any commercial product that has an API that I can turn on/off/query power consumption through a request HTTP request, etc.</p> <p>We just need to control 300w-1200w equivalent LED grow lights.</p>
2018-09-23T15:44:32.490
<p>It sounds like you are looking for something like an accelerometer, or the more complex version, a IMU (inertial measurement unit).</p> <p>These sensors measure acceleration so can detect when an object goes from being at rest (stationary) to moving. They normally measure in 3 axis so can be used to tell in which (relative) direction the object has moved.</p> <p>An IMU also includes a gyroscope so can tell if the object rotates as well as moves.</p>
|sensors|
Some type of movement sensor
3440
<p>I was wondering is there's a sensor or some type of sensor that would detect itself if it's been moved, say if I put the sensor in one end of the table and move it to the other end it will detect that it has been moved?</p> <p>I have seen some sensors that detects motion like <a href="https://learn.adafruit.com/pir-passive-infrared-proximity-motion-sensor/overview" rel="noreferrer">PIR</a> but I think that's not what I'm looking for. So if anyone has an idea of the name I would be glad to check it out.</p> <p>Even if it's pretty basic it's ok, like there's a receiver to detect the motion or whatever.</p>
2018-09-27T07:35:59.507
<p>From client to server you may pack client-id into payload, e.g. if it is JSON, one of the keys can have client-id value.</p> <p>Response from server to client should contain client-id in order to broker to not to broadcast message, but to send it directly to one connected client.</p> <p>At the same time you may subscribe your server to something like: "requests/+" and each client will publish to "request/{client-id-1}", "request/{client-id-2}", and server will receive both with just one subscription.</p>
|mqtt|
Is it necessary to create a x number of MQTT topics for x number of devices?
3459
<p>Currently in my project in which the controller(client) sends sensor data to the server and receives feedback from the server with some additional data, uses MQTT protocol for communication. It has 2 separate topics for client and server.</p> <p>For Example:</p> <p><strong>Topic1 - Client(SUBSCRIBES), Server(PUBLISHES)</strong><br> <strong>Topic2 - Client(PUBLISHES), Server(SUBSCRIBES)</strong></p> <p>But if this project is a use case of a larger application, let's say some 5000 devices need to be installed somewhere.</p> <p>So, will it be needed to create 5000 different topics for both client and server? Or with lesser topics it can be done and how?</p>
2018-09-27T09:27:34.013
<p>You can use the dimmer to added a driver to the app.</p> <p>Follow the steps in the app with the dimmer already added before doing this: Take the dimmer over to driver and hold the pairing button down for about 10seconds on the dimmer right next to the driver (driver must be powered on). The red led will like up, do not let go of the pairing button until the red led turned off. The app should have a pop up saying you have added a new device. If you have a lighting product already connected to the driver during the setup, it you flicker or pulse on/off for a confirmation to let you know the driver has been registered. </p>
|apple-homekit|ikea-tradfri|
Can't connect IKEA TRÅDFRI driver to TRÅDFRI app
3460
<p>I have a 30W TRÅDFRI driver for the kitchen top lights, and I want to control them with a TRÅDFRI dimmer. That works like a charm.</p> <p>What doesn't work, is to add the TRÅDFRI driver to the TRÅDFRI app so I could use my smartphone to control the kitchen top lights through the driver.</p> <p>Pairing the dimmer to the TRÅDFRI app works, but not the driver. I even tried resetting the dimmer and the driver, but to no avail.</p> <p>Any recommendations to make the TRÅDFRI driver visible in the TRÅDFRI app (and Apple Home)?</p>
2018-09-27T18:56:48.537
<p>Agree with hardillb's answer. There is no central repository. To add:</p> <p>MQTT is just the transport on top of which you can layer any other protocol. This is very immature, we only know of a couple of somewhat standard protocols:</p> <ol> <li><p>Sparkplug <a href="https://s3.amazonaws.com/cirrus-link-com/Sparkplug+Topic+Namespace+and+State+ManagementV2.1+Apendix++Payload+B+format.pdf" rel="nofollow noreferrer">https://s3.amazonaws.com/cirrus-link-com/Sparkplug+Topic+Namespace+and+State+ManagementV2.1+Apendix++Payload+B+format.pdf</a> being de-facto standardized by Eclipse <a href="https://projects.eclipse.org/proposals/eclipse-tahu" rel="nofollow noreferrer">https://projects.eclipse.org/proposals/eclipse-tahu</a></p></li> <li><p>LWM2M-MQTT <a href="https://wiki.eclipse.org/images/e/e1/LWM2M_MQTT_EclipseIoTDaysGrenoble.pdf" rel="nofollow noreferrer">https://wiki.eclipse.org/images/e/e1/LWM2M_MQTT_EclipseIoTDaysGrenoble.pdf</a></p></li> <li><p>Each of the cloud IoT platforms (AWS, Azure, etc) has their own topic namespace and protocol.</p></li> <li><p>many ad-hoc implementations. Just subscribe to # on any of the public MQTT brokers (iot.eclipse.org, broker.hivemq.com, etc).</p></li> </ol>
|mqtt|
Are there standard (topic) dictionaries for MQTT-capable devices/sensors?
3465
<p>We are thinking of using MQTT and I was wondering if there was a standard for topic dictionaries a sensors/devices - kind of like a MIB file for SNMP? </p> <p>Are these topic dictionaries published to a central repository?</p>