< 092021-09-10⋎11 >

Topic for #farmOS is: farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Forum: farmOS.discourse.groupSet by mstenta on 2021-06-15 at 12:52
01:19*jonasbits has quit (Ping timeout: 240 seconds)
05:14*jonasbits has joined
05:56*farmBOT has joined
15:14*DanielAshcraft[m has joined
15:16DanielAshcraft[mHello everyone! The company i cofounded centers around open sourcing sensors and iot devices, i am going through and picking a handful of... (full message at libera.ems.host/_matrix/media/r0/downloa)
15:20mstenta[m]1. yes!
15:20mstenta[m]2. this depends on who is hosting farmOS and how they have it configured (to allow http or not), but generally speaking it *should* always be https (and Farmier SaaS hosting is 100% HTTPS fwiw)
15:20mstenta[m]3. There has been some discussion re: MQTT yes! farmos.discourse.group/search?q=mqtt
15:21mstenta[m]the HTTPS question is a good one, though, and one that some friends and I have talked a lot about
15:21mstenta[m]the idea if a "gateway" device seems to be the best option
15:21mstenta[m]where all sensors send to the gateway, and the gateway forwards to farmOS
15:21mstenta[m]and it can be beefier, like a Raspberry Pi or something
15:21DanielAshcraft[mYeah we can do https, but depending on cert response size, we have to throttle our normally 500-800ms sensor push to around 8 seconds on average
15:22mstenta[m]yea, we've done some stuff with Lora sensors too... where they aren't connected to the internet at all... but push to a gateway that is
15:22mstenta[m]that feels like the most scalable approach
15:22mstenta[m](but i'm not a hardware expert) :-)
15:23mstenta[m]also... if you are considering integration, definitely go for farmOS 2.x, not 1.x
15:23DanielAshcraft[mYeah we have plans for an intermediate device as a controller. We're trying to avoid it, because it's mostly unnecessary (depends on who you ask).
15:23DanielAshcraft[mBut the esp32 base we're working with can port forward and mesh, so the idea of adding another device to work around https is a headache haha
15:23mstenta[m]1.x is going to be deprecated soon
15:23mstenta[m]and 2.x has a whole new and improved system for managing "data streams"
15:24mstenta[m]yea understood... my friend ran into the https issue with esp8266, but i think he actually had success with esp32
15:24mstenta[m](again, i'm speaking outside my expertise here)
15:24mstenta[m](just recalling old conversations)
15:25DanielAshcraft[m100% i gotcha. Mqtt seems like it might be a good fit, it's what i've used to integrate with Home Assistant and it's worked wonderfully thus far.
15:25mstenta[m]My understanding of Mqtt is that it requires another service to be running alongside farmOS
15:25mstenta[m]farmOS is basically just Apache, so http server only
15:26DanielAshcraft[mCorrect, hassio uses a mosquito broker i believe
15:26mstenta[m]but it's dockerized, so you could run an mqtt broker alongside it i assume
15:27mstenta[m]Daniel Ashcraft: we have weekly farmOS dev calls if you want to hop on one - can give you an intro to some things in farmOS if that would be useful
15:27mstenta[m]thursdays at noon eastern
15:27DanielAshcraft[mDoes farmio have a plugin based architecture we could potentially extend?
15:27mstenta[m]meet.jit.si/farmos-dev
15:27DanielAshcraft[mI might be able to meet that call, i'll need to check my schedule and double check
15:27mstenta[m]yes! you can write modules that extend it
15:28mstenta[m]farmOS is a Drupal distribution, so they would basically be Drupal modules
15:29mstenta[m]we have some 2.x docs developing here: docs.farmos.org/development/module/
15:29DanielAshcraft[mSweet, i'm not a python person, but i could def brush up and try to get some open source commitment. We're both on open-collective
15:29DanielAshcraft[mso might be able to get some crossover from SPEC.
15:29mstenta[m]PHP actually
15:29DanielAshcraft[mOoof
15:29mstenta[m](the farmOS Aggregator is Python., but that's different)
15:30DanielAshcraft[mgotcha gotcha
15:30mstenta[m]haha like I said, it's Drupal
15:30DanielAshcraft[mi mentally switch drupal with django, i haven't written a line of php in 7 years lol
15:31mstenta[m]easy mixup :-)
15:31mstenta[m]i'm trying to get a link you can use to try out 2.x...
15:31mstenta[m]but if you have docker you can also just spin up a quick dev environment
15:31mstenta[m]docs.farmos.org/development/environment/
15:32mstenta[m]paul121: is there an easy way to spin up a tugboat of latest 2.x outside of issue queues?
15:32DanielAshcraft[mGood to go on docker, i might have to hit some friends up to develop a mqtt integration through drupal, but it can likely be done.
15:32DanielAshcraft[mInterface for passing in mqtt creds, topic construction and the corresponding internal api hooks.
15:34mstenta[m]Yea... or I wonder: would it make sense to have a separate Dockerized service that receives data via MQTT and then just reformats it into an HTTP API request for farmOS?
15:34mstenta[m]then you could just use existing API and wouldn't need to build anything extra in farmOS/Drupal
15:35DanielAshcraft[mThat's actually doable and much more within my skillset
15:35DanielAshcraft[mAre there any current sdk's for farmos or api wrappers in various languages?
15:35mstenta[m]cool!
15:36mstenta[m]yes we have a python library and a JS library: github.com/farmOS/farmOS.py / github.com/farmOS/farmOS.js
15:37DanielAshcraft[mExcellent, i see oauth2, is there an option for a long lived token?
15:37mstenta[m]check the forum link i posted above too... might be some good ideas in there or things people have already done
15:37mstenta[m]farmos.discourse.group/search?q=mqtt
15:37mstenta[m]if you're self-hosting you can customize the token lifespan
15:38mstenta[m]but might be fragile to depend on others doing that
15:38mstenta[m]there are other authorization flows available too besides refresh token
15:39mstenta[m]i think paul121 experimented with JWT
15:39mstenta[m]and there's the username/password authorization too, with security considerations of course
15:40mstenta[m]but you could create a dedicated user for receiving sensor data, and block them if need be
15:40mstenta[m](lots of considerations) :-)
15:40DanielAshcraft[m100%
16:26paul121[m]<mstenta[m]> "paul121: is there an easy way to..." <- When you create a tugboat account you would connect it to your own fork of farmOS
16:28paul121[m]<mstenta[m]> "i think paul121 experimented..." <- actually, all of our 2.x oauth uses JWT - that's more of a "lower level" tech
16:28paul121[m]all of the OAuth tokens are JWT!
16:29paul121[m]OAuth doesn't have a good solution for long lived tokens :-/ (not really what it is designed for)
16:30paul121[m]BUT also worth nothing that our farmOS sensors (data streams in 2.x) use a public/private key for authentication
16:33paul121[m]Daniel Ashcraft: I've done a little bit of preliminary work integrating some sensors & third party data apis with 2.x farmOS data streams
16:34paul121[m]I had explored trying to tie farmOS directly to MQTT in the past, but there definitely needs to be something between the two
16:35paul121[m]here is my latest thinking: dump all sensor data into a separate Influxdb time series database, and make 1 integration with farmOS to Influxdb
16:38paul121[m]an early start on this here: github.com/Vital-Agronomics/farm_influxd
16:39mstenta[m]> BUT also worth nothing that our farmOS sensors (data streams in 2.x) use a public/private key for authentication
16:39mstenta[m]Oh right! I forgot! 😅
16:40mstenta[m]We did that for this very reason
16:40mstenta[m]And to be able to revoke individual sensor push access if necessary
16:40mstenta[m]Not tied to users
16:42paul121[m]what really makes Influxdb so cool is actually a separate service called Telegraf: github.com/influxdata/telegraf
16:42paul121[m]This is what I would use to pull/push data to Influxdb....but Telegraf can be used separate from Influxdb! I think it could be fairly trivial to use it as an MQTT->HTTP POST intermediary
16:43paul121[m]so you could do sensor -> MQTT broker -> telegraf MQTT input -> telegraf HTTP output -> farmOS
16:44paul121[m]I'd like to try that out myself, but really see some benefits of using Influxdb for storage + querying so I'm investing my efforts there :-)
23:30*willinux has joined
23:41*willinux has left (Leaving)

< 092021-09-10⋏11 >