IRC logs for #farmOS, 2019-04-24 (GMT)

2019-04-23
2019-04-25
TimeNickMessage
[20:05:17]* ludwa6_ has joined #farmos
[20:07:12]* ludwa6 has quit (Ping timeout: 255 seconds)
[20:07:12]* ludwa6_ is now known as ludwa6
[22:50:04]* JustTB1 has quit (Ping timeout: 276 seconds)
[23:04:44]* JustTB has joined #farmos
[00:03:09]* JustTB has quit (Ping timeout: 258 seconds)
[04:19:43]* JustTB has joined #farmos
[04:42:30]* JustTB has quit (Ping timeout: 246 seconds)
[04:58:34]* JustTB has joined #farmos
[06:18:20]<MockingbirdConsu>ACTION sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/abzqLjGOlgZLmnDA... >
[06:19:04]<MockingbirdConsu>oh, immediately prior to this in the drupal logs, I have this:
[06:19:05]<MockingbirdConsu>Notice: Undefined index: 1.000000000000000000000000 in Polygon->area() (line 32 of /srv/farm-7.x-1.1/profiles/farm/modules/contrib/geophp/geoPHP/lib/geometry/Polygon.class.php).
[06:19:06]<MockingbirdConsu>Not sure if that makes a difference or not either :)
[07:35:59]<mstenta[m]>Mockingbird Consulting: hmm haven't seen that before. Can you create a bug report on GitHub so we can look into it together?
[07:36:12]<mstenta[m]>Not at my computer right now
[07:36:26]<MockingbirdConsu>Sure, I've managed to break my installation, so let me reset it and I'll log a bug a bit later on :D
[07:36:59]<mstenta[m]>Ok
[07:37:13]<mstenta[m]>Also make sure your server has the minimize requirements
[07:37:23]<mstenta[m]>Minimum*
[07:37:33]<MockingbirdConsu>Will do, thanks :)
[07:38:22]<mstenta[m]>https://farmos.org/hosting/installing/
[07:38:27]<mstenta[m]>I wonder if it might actually be an optional dependency that's missing
[07:39:09]<MockingbirdConsu>possibly, as I say, I'll go back to a base install again and then I'll see if I can recreate it.
[07:43:30]<mstenta[m]>Perfect thanks! Good luck
[08:26:19]<MockingbirdConsu>mstenta: I've created https://github.com/farmOS/farmOS/issues/161 for this
[09:51:23]<paul121[m]>ACTION uploaded an image: Screen Shot 2019-04-24 at 6.44.51 AM.png (84KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/KkABgkigzczMbORX... >
[09:51:23]<paul121[m]>ACTION uploaded an image: Screen Shot 2019-04-24 at 6.45.46 AM.png (170KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/gmPEGwFHcgUToxsf... >
[09:51:24]<paul121[m]>mstenta: So I tried to start up farmOS in docker on my mac last night. I succeeded when I used `dlite`, but keep getting an error otherwise (screenshots above)
[09:51:37]<paul121[m]>I'm running `sudo docker-compose up -d`
[09:53:09]<paul121[m]>That log is from the `farmos_db` container
[09:55:19]<paul121[m]>I also added `:delegated` to these containers
[10:26:22]<mstenta[m]>Hi paul121 - is this using your existing docker environment that was set up previously?
[10:26:31]<mstenta[m]>Or a new one, using the new approach? (I just published it yesterday)
[10:29:39]<mstenta[m]>I don't think the changes I made will break existing environments...
[10:30:05]<mstenta[m]>So let's talk to make sure it didn't break it for you...
[10:32:42]<paul121[m]>I did a `git pull` then noticed you had already updated to the new approach!
[10:33:27]<mstenta[m]>ok, did you do `git pull` in the base directory (where you originally checked out farmOS repo)? or in `.data/www/profiles/farm`?
[10:33:40]<paul121[m]>But...it's basically a new environment. On my dlite, I had to install farmOS from the browser again
[10:33:47]<paul121[m]>Ahh.....Base directory.....
[10:33:57]<mstenta[m]>ok that's fine
[10:34:07]<mstenta[m]>what that means is that the `docker-compose.yml` is no longer there
[10:34:17]<paul121[m]>(I wasn't worried about losing anything)
[10:34:25]<mstenta[m]>i removed that, and instead, put some example docker compose yml files in the `docker` subdir
[10:34:31]<mstenta[m]>so the new recommended approach is....
[10:34:57]<mstenta[m]>INSTEAD of checking out the farmOS repo... you just create a new directory on your computer called `farmOS` (wherever you want)
[10:35:08]<mstenta[m]>and then run:
[10:35:35]<mstenta[m]>ACTION sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/umIEQhTJRJKbKuSp... >
[10:35:44]<mstenta[m]>then you can run `sudo docker-compose up` to start the containers
[10:36:05]<mstenta[m]>in your case, on mac... you can also edit `docker-compose.yml` to add the `:delegated` piece to the two volume mount lines
[10:36:49]<mstenta[m]>when you run `sudo docker-compose up` it will create a `db` and a `www` directory, which is where the database and farmOS codebase files reside, respectively
[10:37:11]<mstenta[m]>jgaehring: FYI^
[10:37:25]<paul121[m]>Ah okay. I did download that `docker-compose.development` file, but it wasn't in a "clean" folder
[10:37:32]<paul121[m]>I will doing in a clean folder tonight!
[10:37:49]<paul121[m]>I will try**
[10:38:08]<mstenta[m]>ok cool! let me know how it goes
[10:39:56]<mstenta[m]>paul121: if you do want to keep your old site (eg: if there was stuff in there you want to save) let me know and I can walk you through migrating it over to the new setup
[10:40:20]<mstenta[m]>otherwise, you can just delete it and continue forward with the new one
[14:59:22]<MockingbirdConsu>Hey folks, me again, I've just logged https://github.com/farmOS/farmOS/issues/163 to talk about how we might integrate LoRaWAN devices into FarmOS more easily. I've started to play with FarmOS and it looks amazing, so if I can get the sensor data from the LoRaWAN kit I'm running in there as well, then that would be the icing on the cake for me!
[14:59:54]<mstenta[m]>donblair: ^
[15:00:15]<mstenta[m]>Mockingbird Consulting: Awesome! I'll take a look at the issue
[15:00:56]<mstenta[m]>@donblair is currently using lora nodes to send data to a gateway device (based on arduino) which then forwards it to farmOS's sensor module via normal HTTP request
[15:01:39]<mstenta[m]>I like your idea of creating a new sensor type in farmOS too!
[15:01:42]<mstenta[m]>That's exactly what the sensor "type" option was designed for
[15:04:10]<MockingbirdConsu>cool. I've put up a PR, but PHP really isn't my primary language any more (last time I used it in anger was just as PHP4 became PHP5! :D ) so it will need a lot of work, but I'm happy to provide infrastructure to test it on
[15:13:00]<MockingbirdConsu>FWIW, the sensor that I'd like to get up and running most is https://www.elsys.se/en/lora-elt-2/ - it's IP-67 rated, can take a range of external sensors, and is ~$160USD with a battery life of up to 7 years...
[15:13:20]<mstenta[m]>whoa neat!
[15:14:40]<MockingbirdConsu>but I've got a range of sensors from home-brew to commercial that we can play with, including (if/when we get to that part) LoRaWAN enabled relay switches, so you could turn on a light from 20 miles away (or do something a lot more useful like operate the sluice gats for a drainage ditch based on the water levels detected downstream etc)
[15:14:50]<MockingbirdConsu>but I've got a range of sensors from home-brew to commercial that we can play with, including (if/when we get to that part) LoRaWAN enabled relay switches, so you could turn on a light from 20 miles away (or do something a lot more useful like operate the sluice gats for a drainage ditch based on the water levels detected downstream etc) just by clicking on the sensor in the UI
[15:15:27]<MockingbirdConsu>heh, I guess editing in here doesn't work in the same way it does in Slack :D
[15:15:35]<mstenta[m]>yea... so we've been giving that idea some thought (triggering relays)
[15:16:17]<mstenta[m]>the main challenge of a client/server architecture like this is that the server (farmOS) can't easily send a request to the client (eg: raspberry pi)
[15:16:31]<mstenta[m]>at least not without a bunch of custom configuration to get through firewalls etc
[15:17:08]<mstenta[m]>so: we've been playing around with flipping it around, so that you could (for example) flip a switch inside farmOS, and the device is checking that on a regular basis - so that if it sees that the switch was flipped, it can act upon that
[15:17:26]<mstenta[m]>obviously means that it isn't instantaneous though
[15:17:51]<mstenta[m]>but for most use-cases that's probably ok
[15:18:05]<mstenta[m]>but also, bigger picture: i don't think devices should ever RELY on farmOS for knowledge
[15:18:21]<mstenta[m]>eg: a device that turns on fans in the greenhouse should not depend on farmOS
[15:18:39]<mstenta[m]>it should have whatever logic it needs internally... so that it doesn't break if it can't connect to farmOS for whatever reason
[15:18:44]<mstenta[m]>resiliency, in other words
[15:18:59]<MockingbirdConsu>ah, ok, yeah, makes sense
[15:19:57]<mstenta[m]>but, farmOS can still serve as a dashboard to view the data, and to flip those switches (knowing that they won't actually happen until the device reads it again)
[15:20:07]<MockingbirdConsu>I'm used to building out fault-resilient clusters for web applications, so to my mind it's more likely the device fails to check in than the cluster goes down, but I've had the luxury of employers paying for the hosting costs, which I guess isn't always an option :D
[15:20:11]<mstenta[m]>so there's still a lot of value in connecting them
[15:21:14]<MockingbirdConsu>ok, so what if "device-based polling" was the default, but for something like loraserver.io, where there's an API available for this stuff already, we have the option of pushing data to that API to trigger the device?
[15:23:00]<mstenta[m]>ah yes!
[15:23:01]<mstenta[m]>exactly
[15:23:07]<mstenta[m]>that could be a great option!
[15:23:12]<mstenta[m]>so how does loraserver.io send data to a device, i wonder?
[15:23:24]<MockingbirdConsu>https://console.ourdata.network/api#!/DeviceQueueService/Enqueue
[15:23:33]<MockingbirdConsu>You ping that endpoint with some JSON
[15:24:04]<MockingbirdConsu>LoRaServer converts the JSON into a base64-encoded blob and sends that over the wire, the device decrypts it and acts accordingly
[15:24:41]<MockingbirdConsu>ACTION sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/aaQYZShBIuWrTbfk... >
[15:25:05]<mstenta[m]>> and sends that over the wire
[15:25:09]<mstenta[m]>How does it do that, though?
[15:25:27]<mstenta[m]>How does the server send a request to the client, in other words?
[15:25:29]<mstenta[m]>client/device
[15:25:33]<MockingbirdConsu>sorry, yes, so the LoRaServer sends a message to the LoRaWAN gateway, the gateway then transmits the packet
[15:25:45]<MockingbirdConsu>and the device picks up the packet and acts accordingly
[15:26:09]<mstenta[m]>Oh ok, sorry i'm not very familiar with lorawan architecture... so the gateway essentially acts as a server that can take requests from the outside world?
[15:26:20]<mstenta[m]>And then passes them to devices it manages?
[15:26:40]<MockingbirdConsu>Kind of, it's closer to a WiFi Router, let me find my architecture diagram...
[15:27:09]<mstenta[m]>Ok that makes sense
[15:27:23]<mstenta[m]>It's a device that is public-facing though, yes?
[15:27:51]<mstenta[m]>(or you set up port forwarding on your router to send traffic to it, i imagine)
[15:28:46]<MockingbirdConsu>ACTION uploaded an image: MBCTTNSetup (2).png (69KB) < https://matrix.org/_matrix/media/v1/download/matrix.org/aTTFwRzQsbgnUVMm... >
[15:29:25]<MockingbirdConsu>In this case, you're replacing the "Analytics Cluster" with FarmOS, but the gateway can sit happily behind a home router or even a corporate firewall, and as long as it can talk to the LoRaServer via MQTT, it's all good.
[15:29:51]<MockingbirdConsu>The devices are "private" in the sense that the only thing they connect to is the LoRaWAN Gateway
[15:30:31]<mstenta[m]>gotcha
[15:30:31]<MockingbirdConsu>and the traffic is encrypted between the LoRaWAN device and the LoRaWAN server, so even if you own a gateway, you can't see what the payload is, only that there was a device sending data through your gateway
[15:30:31]<mstenta[m]>thanks for the explanation!
[15:31:11]<MockingbirdConsu>no worries, it's good for me to revisit it on a frequent basis, I always get slightly different questions depending on my audience!
[15:40:10]* JustTB has quit (Ping timeout: 276 seconds)
[15:54:13]* JustTB has joined #farmos
[18:42:06]* JustTB has quit (Ping timeout: 258 seconds)
[18:42:47]* JustTB has joined #farmos