Return the missing scooter, or the story of one IoT monitoring

A year ago, we launched a pilot version of a promo project for decentralized electric scooter rental .



Initially, the project was called Road-To-Barcelona, ​​later it became Road-To-Berlin (hence the R2B found in the screenshots), and in the end it was named xRide.



The main idea of ​​the project was as follows: instead of having a centralized car or scooter rental service (we will talk about scooters aka electric motorcycles, not kickscooter / scooters), we wanted to make a platform for decentralized rental. We have already written about the difficulties we encountered earlier .



Initially, the project was focused on cars, but due to the timing, extremely long communication with manufacturers and a huge number of safety restrictions, electric scooters were chosen for the pilot.



iOS Android , , peer-to-peer , ETH . Ethereum .



" ", , .



, : .





, , , ( ) : .



?



, β€” IoT .



: , , ?



, ?



β€” , , : , , .



, IT β€” , . " ", .





?





, β€” GPS , , .



β€” , , juicer' .



, Hardware :



  • Bluetooth?
  • GPS ?

    • , GPS "", ,



: , , , (Jolocom, Keycloak).



Hardware





"" ?



β€” Raspberry Pi.

Rpi ( ) β€” ( / ), , , . "xRide box".



, , .



, , "off".



Docker? Plain linux?



, Raspberry β€” ?



, Docker.



, Docker RPi , , .



"" , .



Node.js (sic!) β€” , Go/C/C++.



"" .



, , .



, Docker . OS .



OS



, , , Raspbian ( Debian Pi).



Go, hardware- Go.



GPS, Bluetooth, , , .





(OTA) β€” /, /"" ( , ).



, .



, /dual-boot swupd/SWUpdate/OSTree Mender Balena.



, end-to-end , .



Balena , Docker balenaEngine.



, , Balena Etcher SD β€” .



Mender. Mender , .



, , mender.

, , , .



, , Mender .



Ansible


Ansible. playbook' .



, (CI ) ssh .



β€” , Wi-Fi.



, , IP Ansible Inventory.



Ansible -



3G/LTE



, Ansible , .



, , Wi-Fi .



3G/LTE ( ).



, .



β€” 3G/LTE IP .



SIM , IoT IP . SIM IP .



, IP aka service discovery - Consul, , IP , .



, pull , , push



VPN



VPN β€” Wireguard.



() VPN . .





, , push.





β€” , Kubernetes, . β€” Helm, , . , , , .





, , , :



  • ,
  • / β€”
  • β€”
  • pull β€” push
  • ,








, .



, all-in-one , , . -, , .



, Nagios, icinga zabbix Fleet management.





, , , , "" . .



- , . , Fleet management , .



, , " ", .



, , "" , .



(B)ELK?



, β€” ELK .

BELK, Beats β€” https://www.elastic.co/what-is/elk-stack





, ELK , , .



, ELK , Prometheus.



Grafan'.



, ELK (metricbeat), Kibana .



- ELK :



  • Prometheus
  • Prometheus
  • Kiban' Grafan'


, ELK , Prometheus: TSDB, Victoria Metrics, Cortex . , all-in-one , metricbeat .



ELK :



  • , ,
  • " " β€” ,
  • β€” ,


, open-source X-pack ( ) .



, , .

, - ElastAlert community , .



Loki β€” Grafana β€” Prometheus



Prometheus , Loki , Grafana.



, (- 19 ) Loki 0.3-0.4, produtcion .



Loki , , Promtail ( ) bare-metal, kubernetes.



TICK



, (?) ELK TICK β€” Telegraf, InfluxDB, Chronograf, Kapacitor.





, :



  • Telegraf β€”
  • InfluxDB β€”
  • Kapacitor β€”
  • Chronograf β€”


InfluxDB, Kapacitor Chronograf helm , .



, Influx 2.0 (beta) Kapacitor Chronograf InfluxDB



Telegraf





Telegraf β€” .



, nginx

minecraft.



:



  • ( Go)

  • Push


    • -
  • " "


push , .



, .



Influx syslog.



Telegraf , ICK .



ELK time-series , .



InfluxDB





InfluxDB β€” TICK , time-series .

Influx , , , .



InfluxDB Go , , ELK ( ) .



Influx API , .



β€” $$$ ?


TICK β€” . .



, ?



, TICK β€” .



β€” High availability Enterprise .



HA β€” , - . β€” influxdb-ha , ,

influx-spout β€” NATS ( , ).



, , , β€” , , Influx 2.0 ( ).



Relay β€” HA, ,

InfluxDB load balancer'.



( InfluxDB ).



, ( ), , .



Victoria Metrics?



, , TICK , , InfluxDB , T_CK.





Time-series , β€” Victoria Metrics, :



  • ,
  • ,

  • InfluxDB


Victoria , drop-in InfluxDB.



, , , InfluxDB, β€” "" Prometheus API, Chronograf .



, ( β€” ).



, VM , Influx.



, , Victoria Metrics ,

( ).





, InfluxDB.



:



  • TICK


, - .



, Influx (c ).



β€” TICK .



Kapacitor





Kapacitor β€” TICK , .



( ), β€” .



. Slack , , .





, , .



β€” - "", .



Influx 2.0 Kapacitor DB



Chronograf





UI , , UX Chronograf'.



TICK , , Grafan' -.

, .



, Grafana , Chronograf Influx.



, , Chronograf .



, Chronograf , InfluxDB Explore.



, Grafana , Chronograf ( ), Grafana JSON ( Chronograf "" JSON β€” UI).



Kibana , UX .



. Chronograf , .



, , Grafana Kibana :





:





, , InfluxDB Query mean.



, Chronograf . :





Influx syslog β€” severity.



, severity .



, .



, , .



- , , , ( LTE ), "" Slack , .



, severity .



Slack . .





, Chronograf OAuth OIDC .



, SSO.



β€” Keycloak β€” , back-end.



β€œβ€



, β€” "" Vue.

, , InfluxDB.



, , .



. , Grafana Chronograf β€” Grafana , . , Grafana , , , , , ( , ).



Influx β€” .

.



: , , , bluetooth, GPS, healthcheck'.

.



, β€” Influx Nodes " ".



deadman β€” Slack.



, β€”



. " β€” !"







, InfluxDB , Victoria Metrics.



, β€” , ( β€” enum)?



, , .

, " " , , .



API , , .



Influx. - status InfluxDB .



- "online" "offline", , Slack . - "disconnected".



, , - .



, β€” .



, , . , , .





, InfluxDB GPS . .

, .



, ( ).





, ( ) .



:





, :





, :



  • Keycloak


Kubernetes, .



, Telegraf " " Kubernetes , Chronograf .



. β€” Slack.



Kubernetes : DaemonSet Sidecar.

.



Telegraf Sidecar .



. Telegraf Docker API, syslog . , , Chronograf'e.



???


, , , .



Telegraf InfluxDB Influx, - .





?





β€” TICK , , .



, , . β€” .





TICK β€” . .



/ , 30 .



. . 10 .



, , " " , 30 . , LTE SIM .



, 10- .



, - , .



, β€” WireGuard VPN.



, environment , .



InfluxDB 10 - .



TICK β€” -


, TICK , - HighLoad.



β€” InfluxDB .



Influx Relay High Availability.



, , "" .



, / "" β€” TICK .



, InfluxDB Enterprise β€” - , . ,   .



, , Victoria Metrics Loki.



, , Loki/Grafana ( ) TICK, .



: Influx 1.8, - Influx 2.0.



, , ( kapacitor chronograf),

(" " β€” Fortnite ). , , 2 , β€” .



Influx 2.0 , - , , .



IoT ()



, IoT , .



, Beta OpenBalena β€” .



Ansible + TICK + WireGuard, . , Balena IoT .



, , , OpenBalena , .



, VPN IoT .



β€” Hardware, .



, ?



, "", .



"", GPS InfluxDB.



, , 21:00 , - - 5 - .



5 β€” , - .

, , . .



, .



, , , () . - .



. , , , ...




All Articles