Skip to main content

Posts

FLiP-Py-Pi-EnviroPlus - Using Apache Pulsar with Apache Spark, Apache Flink for processing sensor data

  FLiP-Py-Pi-EnviroPlus FLiP-Py-Pi-EnviroPlus. Apache Flink, Apache Pulsar, Apache Spark, Python, Raspberry Pi, Enviro+ sensors. Tim streamnative Code ( https://github.com/tspannhw/FLiP-Py-Pi-EnviroPlus )  client = pulsar.Client('pulsar://pulsar1:6650') producer = client.create_producer(topic='persistent://public/default/rp4enviroplus' ,schema=JsonSchema(enviroplus),properties={"producer-name": "enviroplus-py-sensor","producer-id": "enviroplus-sensor" }) enviroRec = enviroplus() enviroRec.adjtemp = str(adjtemp) fa=open("/opt/demo/logs/envprec.log", "a+") fa.write(str(enviroRec) + "\n") fa.close() print(enviroRec) producer.send(enviroRec,partition_key=str(uniqueid)) Json Schema class enviroplus(Record): adjtemp = String() adjtempf = String() amplitude100 = Float() amplitude1000 = Float() amplitude500 = Float() amps = Float() cpu = Float() cputemp = String() cputem

FLiP-Py-Pi-GasThermal: Building an IoT Edge Application with Apache Pulsar and Python for TVOC and CO2 Ingest

  FLiP-Py-Pi-GasThermal Source:   https://github.com/tspannhw/FLiP-Py-Pi-GasThermal tags:  Apache Pulsar, Python, Raspberry Pi, Gas Sensor + Thermal Camera Sensors, Apache Flink, Trino/Presto SQL Sensors Pimoroni BreakoutGarden: SGP30 Sensiron SGP30 TVOC and eCO2 sensor (datasheet) TVOC sensing from 0-60,000 ppb (parts per billion) CO2 sensing from 400 to 60,000 ppm (parts per million) Pimoroni BreakoutGarden: MLX90640 Thermal Camera Architecture     Build bin/pulsar-admin topics create persistent://public/default/garden3 bin/pulsar-client consume "persistent://public/default/garden3" -s "garden3reader" -n 0 class Garden(Record): cpu = Float() diskusage = String() endtime = String() equivalentco2ppm = String() host = String() hostname = String() ipaddress = String() macaddress = String() memory = Float() rowid = String() runtime = Integer() starttime = String() systemtime = String() totalvocppb = String()