diff --git a/folder/ar/BuildIT.md b/folder/ar/BuildIT.md index bd71c91..dc8763b 100644 --- a/folder/ar/BuildIT.md +++ b/folder/ar/BuildIT.md @@ -1,14 +1,15 @@ -# Building an environment sensor - -To build your own AstroPiOTA environment sensor, you need a SenseHat,a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB) +# Building your own AstroPiQuake environment sensor +

Sense HAT version 1.0
+
+ +
Raspberry Pi 3 B
+
-###
Raspberry Pi 3 B
- -Get the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Don't use a Raspberry Pi 3 B+ (B plus) because it has pins that prevent attaching Sense HAT version 1.0** +Buy a SenseHat, a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB). I used SenseHat version 1.0 and the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Make sure the pins on SenseHat line up with the Raspberry Pi. For example, a Raspberry Pi 3 B+ (B plus) has pins that prevent attaching Sense HAT version 1.0** ### Connecting SenseHat @@ -28,6 +29,6 @@ You can connect remotely using Secure Shell (SSH). First, you must enable SSH. ![Window for enabling SSH as described in text](images/SSH.png) -### Installing software +## Configuring AstroPiQuake and installing software -[Install AstroPiOTA Software](InstallIT.md) +[Configuring AstroPiQuake and installing software](InstallIT.md) diff --git a/folder/ar/Headless.md b/folder/ar/Headless.md index 93dff57..f55a82c 100644 --- a/folder/ar/Headless.md +++ b/folder/ar/Headless.md @@ -1,6 +1,6 @@ -# Running in headless mode (optional) +# Running AstroPiQuake in headless mode -If you plan to run AstroPiOTA without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. Configure a cron job so Raspberry Pi runs this script at every reboot. +If you plan to run AstroPiQuake without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. You can configure a cron job so Raspberry Pi runs this script every time your boot. ### Getting the IP address @@ -20,7 +20,7 @@ sense = SenseHat() def getIP(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: - s.connect(('192.168.255.255',1)) #lab network used for this example + s.connect(('192.168.255.255',1)) IP = s.getsockname()[0] except: IP = '127.0.0.1' @@ -47,7 +47,7 @@ python3 senseIP.py ![Screen capture of shell script described in text](images/RasSenseIP.png) -Save the schell script then reset the permissions +Save the schell script then set the permissions to add permission to eXecute the script ``` sudo chmod +x senseBoot.sh @@ -68,10 +68,11 @@ Add this command at the bottom Unplug monitor, keyboard, and mouse, then reboot Raspberry Pi. Wait a second or two, then watch the IP address scrolling across the Sense HAT LED screen. -Take a look at the AstroPiOTA emulator - Now you can connect to Raspberry Pi using SSH. When you want to shutdown, type: ``` sudo shutdown now ``` + ## Using your AstroPiQuake + + [AstroPiQuake](https://github.com/NelsonPython/AstroPiQuake) diff --git a/folder/ar/InstallIT.md b/folder/ar/InstallIT.md index 8b213cf..0f8dce5 100644 --- a/folder/ar/InstallIT.md +++ b/folder/ar/InstallIT.md @@ -1,19 +1,13 @@ -# Installing software and configuring your device +# Configuring AstroPiQuake and installing software -First, you must configure your Raspberry Pi. Next, install the SenseHat drivers. Finally, install the IOTA Python client library, IOTA Python Workshop, and copy the AstroPiOTA scripts. - -## Configuring Raspberry Pi - -When connecting directly the first time, Raspberry Pi will automatically boot with the default user and password: +When connecting directly the first time, Raspberry Pi will automatically boot with the default username and password: ``` Default username: pi Default password: raspberry ``` -Using the Raspberry Pi Configuration tool, set the keyboard mapping to USA English. Otherwise, you will be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. - -Click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. +It will also expect you to use a British keyboard. You may be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. To change the keyboard settings, click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. ![RasPi configuration window as described in text](images/Localisation.png) @@ -21,35 +15,16 @@ Set your Locale, Timezone, and WiFi country. Then, click on the `Set Keyboard.. ![Window for setting localisation as described in text](images/localisation2.png) -Select `United States -> English (US)` - -## Installing Sense HAT - -Install Sense Hat: - -``` -sudo apt-get update -sudo apt-get install sense-hat -sudo pip-3.2 install pillow -``` -See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information - -For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen: +Select `United States -> English (US)` -``` -$ python3 ->>>from sense_hat import SenseHat ->>>sense = SenseHat() ->>>sense.show_message("Hello Sense Hat") -``` +Known bugs -The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiOTA emulator +- As of October 2019, Raspberry Pi Buster operating system may have a WiFi Bug: https://www.raspberrypi.org/forums/viewtopic.php?t=252984 -To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) -## Verifying the version of Python +## Verifying your version of Python -Verify that Python3 has been pre-installed: +Different Raspberry Pi operating systems ship with different versions of Python and Pip. Verify that Python3 has been pre-installed: ``` python3 --version @@ -63,42 +38,30 @@ $ pip 18.0 from /usr/local/lib/python3.4/dist-packages/pip-18.0-py3.4.egg/pip ( Note: This tutorial has not been tested using Python 3.6 or 3.7 -## Installing the [Python IOTA Workshop scripts](https://github.com/iota-community/python-iota-workshop) +## Installing Sense HAT software -This installs the Pyota client library so you can communicate with the [Tangle](https://docs.iota.org/docs/dev-essentials/0.1/concepts/the-tangle). The workshop includes a step-by-step tutorial teaching the details of sending and receiving transactions to the Tangle. They provide the foundation for the code used to store sensor data from AstroPiOTA. +Install Sense Hat: -Clone the github repository, install the workshop code, and run the "hello world" example. ``` -git clone https://github.com/iota-community/python-iota-workshop.git -cd python-iota-workshop -pip3 install -r requirements.txt -python3 code/e01_hello_world.py +sudo apt-get update +sudo apt-get install sense-hat +sudo pip3 install pillow ``` +See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information -The Tangle will respond with the latest statistics: +For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen. Follow these commands: ``` -{'appName': 'IRI Testnet', - 'appVersion': '1.8.0-RC1', - 'coordinatorAddress': 'EQQFCZBIHRHWPXKMTOLMYUYPCN9XLMJPYZVFJSAY9FQHCCLWTOLLUGKKMXYFDBOOYFBLBI9WUEILGECYM', - 'duration': 0, - 'features': ['dnsRefresher', 'testnet', 'zeroMessageQueue', 'RemotePOW'], - 'jreAvailableProcessors': 8, - 'jreFreeMemory': 14557498488, - 'jreMaxMemory': 22906667008, - 'jreTotalMemory': 16883646464, - 'jreVersion': '1.8.0_181', - 'lastSnapshottedMilestoneIndex': 434525, - 'latestMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestMilestoneIndex': 1313715, - 'latestSolidSubtangleMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestSolidSubtangleMilestoneIndex': 1313715, - 'milestoneStartIndex': 434527, - 'neighbors': 3, - 'packetsQueueSize': 0, - 'time': 1565638086467, - 'tips': 733, - 'transactionsToRequest': 0} +$ python3 +>>>from sense_hat import SenseHat +>>>sense = SenseHat() +>>>sense.show_message("Hello Sense Hat") ``` -[Running in headless mode](Headless.md) +The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiQuake emulator + +To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) + +## Optional: running AstroPiQuake in headless mode + +[Running AstroPiQuake in headless mode](Headless.md) diff --git a/folder/ar/README.md b/folder/ar/README.md index aa8d2bd..c50f194 100644 --- a/folder/ar/README.md +++ b/folder/ar/README.md @@ -1 +1,43 @@ -Language translations from Crowdin +## AstroPiQuake + +AstroPiQuake gathers environment data using SenseHat and Raspberry Pi + +[AstroPi](https://www.nasa.gov/mission_pages/station/research/experiments/explorer/Investigation.html?#id=7534) flies onboard the International Space Station (ISS) keeping astronauts update-to-date about their environment. Here on Earth, you can monitor your local environment data and detect earthquakes using a clone of AstroPi called "AstroPiQuake" + +Try out the [AstroPiQuake emulator](https://trinket.io/python/9c2e984979). Move the temperature slider to see Smiley's face change colors from cool blue to mellow yellow to red hot. Take a look at [earthquake detection](https://trinket.io/python/86417fad20). Grab AstroPiQuake with your mouse and shake it. Watch the graph change as it detects you simulating an earthquake. + +### Sensing environment data + +Sense Hat has temperature and humidity sensors. It can sense the barometric pressure. It has an IMU or Inertial Measurement Unit with an accelerometer that measures acceleration forces, a gyroscope that measures momentum and rotation, and a magnetometer that measures the Earth’s own magnetic field, similar to a compass. Here are the [technical specifications](SenseHatSpecs.md). + +Accelerometer and gyroscope data are measured using [coordinates](https://en.wikipedia.org/wiki/Euler_angles). These are sometimes referred to as yaw, pitch, and roll. + + x is yaw or rotation about the x-axis + y is pitch or rotation about the y-axis + z is roll or rotation about the z-axis + + +## Building your own AstroPiQuake + +[Building your own AstroPiQuake environment sensor](BuildIT.md) + +[Configuring AstroPiQuake and installing software](InstallIT.md) + +[Optional: running AstroPiQuake in headless mode](Headless.md) + +## Gathering data + +Watching sensor readings + +Saving sensor data in a MySQL table + +## Investigating your data + +[Charting your AstroPiQuake data on ThingSpeak](https://thingspeak.com/channels/865101) + +## Experimenting + +[Broadcasting messages onboard an AV](https://github.com/NelsonPython/DriveI5) + +[Detecting earthquakes](https://www.kaggle.com/nelsondata/confirming-earthquake-detection) + diff --git a/folder/ar/viewAstroPiQuake.md b/folder/ar/viewAstroPiQuake.md new file mode 100644 index 0000000..647fa50 --- /dev/null +++ b/folder/ar/viewAstroPiQuake.md @@ -0,0 +1,43 @@ +

Viewing AstroPiQuake sensor data

+ +AstroPiQuake senses temperature, humidity, and pressure. It gets gyroscope and accelerometer readings. + +This getData.py script senses data and prints it in json format + +``` +#!/usr/bin/python + +import datetime +from sense_hat import SenseHat + +sense = SenseHat() + +sensors = {} +sensors["pressure"] = str(sense.get_pressure()) +sensors["temperature"] = str(sense.get_temperature()) +sensors["humidity"] = str(sense.get_humidity()) + +o = sense.get_orientation() +sensors["pitch"] = str(o["pitch"]) +sensors["roll"] = str(o["roll"]) +sensors["yaw"] = str(o["yaw"]) + +a = sense.get_accelerometer_raw() +sensors["x"] = str(a["x"]) +sensors["y"] = str(a["y"]) +sensors["z"] = str(a["z"]) + +t = datetime.datetime.now() +sensors["timestamp"] = str(t.strftime('%Y%m%d %H:%M')) +sensors["lng"] = '-118.323411' +sensors["lat"] = '33.893916' +sensors["device_name"] = "AstroPiQuake" + +print(sensors) +``` + +

json

+ +``` +{'pressure': '0', 'lat': '33.893916', 'z': '-0.02169257216155529', 'pitch': '2.6417886780271713', 'roll': '281.7232590548508', 'yaw': '134.7106325472459', 'lng': '-118.323411', 'y': '-0.972381591796875', 'humidity': '39.247840881347656', 'device_name': 'AstroPiQuake', 'x': '-0.0034556991886347532', 'timestamp': '20200528 12:31', 'temperature': '31.669998168945312'} +``` diff --git a/folder/en/BuildIT.md b/folder/en/BuildIT.md index bd71c91..dc8763b 100644 --- a/folder/en/BuildIT.md +++ b/folder/en/BuildIT.md @@ -1,14 +1,15 @@ -# Building an environment sensor - -To build your own AstroPiOTA environment sensor, you need a SenseHat,a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB) +# Building your own AstroPiQuake environment sensor +

Sense HAT version 1.0
+
+ +
Raspberry Pi 3 B
+
-###
Raspberry Pi 3 B
- -Get the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Don't use a Raspberry Pi 3 B+ (B plus) because it has pins that prevent attaching Sense HAT version 1.0** +Buy a SenseHat, a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB). I used SenseHat version 1.0 and the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Make sure the pins on SenseHat line up with the Raspberry Pi. For example, a Raspberry Pi 3 B+ (B plus) has pins that prevent attaching Sense HAT version 1.0** ### Connecting SenseHat @@ -28,6 +29,6 @@ You can connect remotely using Secure Shell (SSH). First, you must enable SSH. ![Window for enabling SSH as described in text](images/SSH.png) -### Installing software +## Configuring AstroPiQuake and installing software -[Install AstroPiOTA Software](InstallIT.md) +[Configuring AstroPiQuake and installing software](InstallIT.md) diff --git a/folder/en/Headless.md b/folder/en/Headless.md index 93dff57..f55a82c 100644 --- a/folder/en/Headless.md +++ b/folder/en/Headless.md @@ -1,6 +1,6 @@ -# Running in headless mode (optional) +# Running AstroPiQuake in headless mode -If you plan to run AstroPiOTA without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. Configure a cron job so Raspberry Pi runs this script at every reboot. +If you plan to run AstroPiQuake without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. You can configure a cron job so Raspberry Pi runs this script every time your boot. ### Getting the IP address @@ -20,7 +20,7 @@ sense = SenseHat() def getIP(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: - s.connect(('192.168.255.255',1)) #lab network used for this example + s.connect(('192.168.255.255',1)) IP = s.getsockname()[0] except: IP = '127.0.0.1' @@ -47,7 +47,7 @@ python3 senseIP.py ![Screen capture of shell script described in text](images/RasSenseIP.png) -Save the schell script then reset the permissions +Save the schell script then set the permissions to add permission to eXecute the script ``` sudo chmod +x senseBoot.sh @@ -68,10 +68,11 @@ Add this command at the bottom Unplug monitor, keyboard, and mouse, then reboot Raspberry Pi. Wait a second or two, then watch the IP address scrolling across the Sense HAT LED screen. -Take a look at the AstroPiOTA emulator - Now you can connect to Raspberry Pi using SSH. When you want to shutdown, type: ``` sudo shutdown now ``` + ## Using your AstroPiQuake + + [AstroPiQuake](https://github.com/NelsonPython/AstroPiQuake) diff --git a/folder/en/InstallIT.md b/folder/en/InstallIT.md index 8b213cf..0f8dce5 100644 --- a/folder/en/InstallIT.md +++ b/folder/en/InstallIT.md @@ -1,19 +1,13 @@ -# Installing software and configuring your device +# Configuring AstroPiQuake and installing software -First, you must configure your Raspberry Pi. Next, install the SenseHat drivers. Finally, install the IOTA Python client library, IOTA Python Workshop, and copy the AstroPiOTA scripts. - -## Configuring Raspberry Pi - -When connecting directly the first time, Raspberry Pi will automatically boot with the default user and password: +When connecting directly the first time, Raspberry Pi will automatically boot with the default username and password: ``` Default username: pi Default password: raspberry ``` -Using the Raspberry Pi Configuration tool, set the keyboard mapping to USA English. Otherwise, you will be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. - -Click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. +It will also expect you to use a British keyboard. You may be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. To change the keyboard settings, click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. ![RasPi configuration window as described in text](images/Localisation.png) @@ -21,35 +15,16 @@ Set your Locale, Timezone, and WiFi country. Then, click on the `Set Keyboard.. ![Window for setting localisation as described in text](images/localisation2.png) -Select `United States -> English (US)` - -## Installing Sense HAT - -Install Sense Hat: - -``` -sudo apt-get update -sudo apt-get install sense-hat -sudo pip-3.2 install pillow -``` -See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information - -For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen: +Select `United States -> English (US)` -``` -$ python3 ->>>from sense_hat import SenseHat ->>>sense = SenseHat() ->>>sense.show_message("Hello Sense Hat") -``` +Known bugs -The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiOTA emulator +- As of October 2019, Raspberry Pi Buster operating system may have a WiFi Bug: https://www.raspberrypi.org/forums/viewtopic.php?t=252984 -To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) -## Verifying the version of Python +## Verifying your version of Python -Verify that Python3 has been pre-installed: +Different Raspberry Pi operating systems ship with different versions of Python and Pip. Verify that Python3 has been pre-installed: ``` python3 --version @@ -63,42 +38,30 @@ $ pip 18.0 from /usr/local/lib/python3.4/dist-packages/pip-18.0-py3.4.egg/pip ( Note: This tutorial has not been tested using Python 3.6 or 3.7 -## Installing the [Python IOTA Workshop scripts](https://github.com/iota-community/python-iota-workshop) +## Installing Sense HAT software -This installs the Pyota client library so you can communicate with the [Tangle](https://docs.iota.org/docs/dev-essentials/0.1/concepts/the-tangle). The workshop includes a step-by-step tutorial teaching the details of sending and receiving transactions to the Tangle. They provide the foundation for the code used to store sensor data from AstroPiOTA. +Install Sense Hat: -Clone the github repository, install the workshop code, and run the "hello world" example. ``` -git clone https://github.com/iota-community/python-iota-workshop.git -cd python-iota-workshop -pip3 install -r requirements.txt -python3 code/e01_hello_world.py +sudo apt-get update +sudo apt-get install sense-hat +sudo pip3 install pillow ``` +See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information -The Tangle will respond with the latest statistics: +For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen. Follow these commands: ``` -{'appName': 'IRI Testnet', - 'appVersion': '1.8.0-RC1', - 'coordinatorAddress': 'EQQFCZBIHRHWPXKMTOLMYUYPCN9XLMJPYZVFJSAY9FQHCCLWTOLLUGKKMXYFDBOOYFBLBI9WUEILGECYM', - 'duration': 0, - 'features': ['dnsRefresher', 'testnet', 'zeroMessageQueue', 'RemotePOW'], - 'jreAvailableProcessors': 8, - 'jreFreeMemory': 14557498488, - 'jreMaxMemory': 22906667008, - 'jreTotalMemory': 16883646464, - 'jreVersion': '1.8.0_181', - 'lastSnapshottedMilestoneIndex': 434525, - 'latestMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestMilestoneIndex': 1313715, - 'latestSolidSubtangleMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestSolidSubtangleMilestoneIndex': 1313715, - 'milestoneStartIndex': 434527, - 'neighbors': 3, - 'packetsQueueSize': 0, - 'time': 1565638086467, - 'tips': 733, - 'transactionsToRequest': 0} +$ python3 +>>>from sense_hat import SenseHat +>>>sense = SenseHat() +>>>sense.show_message("Hello Sense Hat") ``` -[Running in headless mode](Headless.md) +The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiQuake emulator + +To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) + +## Optional: running AstroPiQuake in headless mode + +[Running AstroPiQuake in headless mode](Headless.md) diff --git a/folder/en/README.md b/folder/en/README.md index aa8d2bd..c50f194 100644 --- a/folder/en/README.md +++ b/folder/en/README.md @@ -1 +1,43 @@ -Language translations from Crowdin +## AstroPiQuake + +AstroPiQuake gathers environment data using SenseHat and Raspberry Pi + +[AstroPi](https://www.nasa.gov/mission_pages/station/research/experiments/explorer/Investigation.html?#id=7534) flies onboard the International Space Station (ISS) keeping astronauts update-to-date about their environment. Here on Earth, you can monitor your local environment data and detect earthquakes using a clone of AstroPi called "AstroPiQuake" + +Try out the [AstroPiQuake emulator](https://trinket.io/python/9c2e984979). Move the temperature slider to see Smiley's face change colors from cool blue to mellow yellow to red hot. Take a look at [earthquake detection](https://trinket.io/python/86417fad20). Grab AstroPiQuake with your mouse and shake it. Watch the graph change as it detects you simulating an earthquake. + +### Sensing environment data + +Sense Hat has temperature and humidity sensors. It can sense the barometric pressure. It has an IMU or Inertial Measurement Unit with an accelerometer that measures acceleration forces, a gyroscope that measures momentum and rotation, and a magnetometer that measures the Earth’s own magnetic field, similar to a compass. Here are the [technical specifications](SenseHatSpecs.md). + +Accelerometer and gyroscope data are measured using [coordinates](https://en.wikipedia.org/wiki/Euler_angles). These are sometimes referred to as yaw, pitch, and roll. + + x is yaw or rotation about the x-axis + y is pitch or rotation about the y-axis + z is roll or rotation about the z-axis + + +## Building your own AstroPiQuake + +[Building your own AstroPiQuake environment sensor](BuildIT.md) + +[Configuring AstroPiQuake and installing software](InstallIT.md) + +[Optional: running AstroPiQuake in headless mode](Headless.md) + +## Gathering data + +Watching sensor readings + +Saving sensor data in a MySQL table + +## Investigating your data + +[Charting your AstroPiQuake data on ThingSpeak](https://thingspeak.com/channels/865101) + +## Experimenting + +[Broadcasting messages onboard an AV](https://github.com/NelsonPython/DriveI5) + +[Detecting earthquakes](https://www.kaggle.com/nelsondata/confirming-earthquake-detection) + diff --git a/folder/en/viewAstroPiQuake.md b/folder/en/viewAstroPiQuake.md new file mode 100644 index 0000000..647fa50 --- /dev/null +++ b/folder/en/viewAstroPiQuake.md @@ -0,0 +1,43 @@ +

Viewing AstroPiQuake sensor data

+ +AstroPiQuake senses temperature, humidity, and pressure. It gets gyroscope and accelerometer readings. + +This getData.py script senses data and prints it in json format + +``` +#!/usr/bin/python + +import datetime +from sense_hat import SenseHat + +sense = SenseHat() + +sensors = {} +sensors["pressure"] = str(sense.get_pressure()) +sensors["temperature"] = str(sense.get_temperature()) +sensors["humidity"] = str(sense.get_humidity()) + +o = sense.get_orientation() +sensors["pitch"] = str(o["pitch"]) +sensors["roll"] = str(o["roll"]) +sensors["yaw"] = str(o["yaw"]) + +a = sense.get_accelerometer_raw() +sensors["x"] = str(a["x"]) +sensors["y"] = str(a["y"]) +sensors["z"] = str(a["z"]) + +t = datetime.datetime.now() +sensors["timestamp"] = str(t.strftime('%Y%m%d %H:%M')) +sensors["lng"] = '-118.323411' +sensors["lat"] = '33.893916' +sensors["device_name"] = "AstroPiQuake" + +print(sensors) +``` + +

json

+ +``` +{'pressure': '0', 'lat': '33.893916', 'z': '-0.02169257216155529', 'pitch': '2.6417886780271713', 'roll': '281.7232590548508', 'yaw': '134.7106325472459', 'lng': '-118.323411', 'y': '-0.972381591796875', 'humidity': '39.247840881347656', 'device_name': 'AstroPiQuake', 'x': '-0.0034556991886347532', 'timestamp': '20200528 12:31', 'temperature': '31.669998168945312'} +``` diff --git a/folder/es/BuildIT.md b/folder/es/BuildIT.md index bd71c91..dc8763b 100644 --- a/folder/es/BuildIT.md +++ b/folder/es/BuildIT.md @@ -1,14 +1,15 @@ -# Building an environment sensor - -To build your own AstroPiOTA environment sensor, you need a SenseHat,a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB) +# Building your own AstroPiQuake environment sensor +

Sense HAT version 1.0
+
+ +
Raspberry Pi 3 B
+
-###
Raspberry Pi 3 B
- -Get the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Don't use a Raspberry Pi 3 B+ (B plus) because it has pins that prevent attaching Sense HAT version 1.0** +Buy a SenseHat, a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB). I used SenseHat version 1.0 and the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Make sure the pins on SenseHat line up with the Raspberry Pi. For example, a Raspberry Pi 3 B+ (B plus) has pins that prevent attaching Sense HAT version 1.0** ### Connecting SenseHat @@ -28,6 +29,6 @@ You can connect remotely using Secure Shell (SSH). First, you must enable SSH. ![Window for enabling SSH as described in text](images/SSH.png) -### Installing software +## Configuring AstroPiQuake and installing software -[Install AstroPiOTA Software](InstallIT.md) +[Configuring AstroPiQuake and installing software](InstallIT.md) diff --git a/folder/es/Headless.md b/folder/es/Headless.md index 93dff57..f55a82c 100644 --- a/folder/es/Headless.md +++ b/folder/es/Headless.md @@ -1,6 +1,6 @@ -# Running in headless mode (optional) +# Running AstroPiQuake in headless mode -If you plan to run AstroPiOTA without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. Configure a cron job so Raspberry Pi runs this script at every reboot. +If you plan to run AstroPiQuake without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. You can configure a cron job so Raspberry Pi runs this script every time your boot. ### Getting the IP address @@ -20,7 +20,7 @@ sense = SenseHat() def getIP(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: - s.connect(('192.168.255.255',1)) #lab network used for this example + s.connect(('192.168.255.255',1)) IP = s.getsockname()[0] except: IP = '127.0.0.1' @@ -47,7 +47,7 @@ python3 senseIP.py ![Screen capture of shell script described in text](images/RasSenseIP.png) -Save the schell script then reset the permissions +Save the schell script then set the permissions to add permission to eXecute the script ``` sudo chmod +x senseBoot.sh @@ -68,10 +68,11 @@ Add this command at the bottom Unplug monitor, keyboard, and mouse, then reboot Raspberry Pi. Wait a second or two, then watch the IP address scrolling across the Sense HAT LED screen. -Take a look at the AstroPiOTA emulator - Now you can connect to Raspberry Pi using SSH. When you want to shutdown, type: ``` sudo shutdown now ``` + ## Using your AstroPiQuake + + [AstroPiQuake](https://github.com/NelsonPython/AstroPiQuake) diff --git a/folder/es/InstallIT.md b/folder/es/InstallIT.md index 8b213cf..0f8dce5 100644 --- a/folder/es/InstallIT.md +++ b/folder/es/InstallIT.md @@ -1,19 +1,13 @@ -# Installing software and configuring your device +# Configuring AstroPiQuake and installing software -First, you must configure your Raspberry Pi. Next, install the SenseHat drivers. Finally, install the IOTA Python client library, IOTA Python Workshop, and copy the AstroPiOTA scripts. - -## Configuring Raspberry Pi - -When connecting directly the first time, Raspberry Pi will automatically boot with the default user and password: +When connecting directly the first time, Raspberry Pi will automatically boot with the default username and password: ``` Default username: pi Default password: raspberry ``` -Using the Raspberry Pi Configuration tool, set the keyboard mapping to USA English. Otherwise, you will be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. - -Click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. +It will also expect you to use a British keyboard. You may be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. To change the keyboard settings, click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. ![RasPi configuration window as described in text](images/Localisation.png) @@ -21,35 +15,16 @@ Set your Locale, Timezone, and WiFi country. Then, click on the `Set Keyboard.. ![Window for setting localisation as described in text](images/localisation2.png) -Select `United States -> English (US)` - -## Installing Sense HAT - -Install Sense Hat: - -``` -sudo apt-get update -sudo apt-get install sense-hat -sudo pip-3.2 install pillow -``` -See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information - -For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen: +Select `United States -> English (US)` -``` -$ python3 ->>>from sense_hat import SenseHat ->>>sense = SenseHat() ->>>sense.show_message("Hello Sense Hat") -``` +Known bugs -The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiOTA emulator +- As of October 2019, Raspberry Pi Buster operating system may have a WiFi Bug: https://www.raspberrypi.org/forums/viewtopic.php?t=252984 -To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) -## Verifying the version of Python +## Verifying your version of Python -Verify that Python3 has been pre-installed: +Different Raspberry Pi operating systems ship with different versions of Python and Pip. Verify that Python3 has been pre-installed: ``` python3 --version @@ -63,42 +38,30 @@ $ pip 18.0 from /usr/local/lib/python3.4/dist-packages/pip-18.0-py3.4.egg/pip ( Note: This tutorial has not been tested using Python 3.6 or 3.7 -## Installing the [Python IOTA Workshop scripts](https://github.com/iota-community/python-iota-workshop) +## Installing Sense HAT software -This installs the Pyota client library so you can communicate with the [Tangle](https://docs.iota.org/docs/dev-essentials/0.1/concepts/the-tangle). The workshop includes a step-by-step tutorial teaching the details of sending and receiving transactions to the Tangle. They provide the foundation for the code used to store sensor data from AstroPiOTA. +Install Sense Hat: -Clone the github repository, install the workshop code, and run the "hello world" example. ``` -git clone https://github.com/iota-community/python-iota-workshop.git -cd python-iota-workshop -pip3 install -r requirements.txt -python3 code/e01_hello_world.py +sudo apt-get update +sudo apt-get install sense-hat +sudo pip3 install pillow ``` +See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information -The Tangle will respond with the latest statistics: +For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen. Follow these commands: ``` -{'appName': 'IRI Testnet', - 'appVersion': '1.8.0-RC1', - 'coordinatorAddress': 'EQQFCZBIHRHWPXKMTOLMYUYPCN9XLMJPYZVFJSAY9FQHCCLWTOLLUGKKMXYFDBOOYFBLBI9WUEILGECYM', - 'duration': 0, - 'features': ['dnsRefresher', 'testnet', 'zeroMessageQueue', 'RemotePOW'], - 'jreAvailableProcessors': 8, - 'jreFreeMemory': 14557498488, - 'jreMaxMemory': 22906667008, - 'jreTotalMemory': 16883646464, - 'jreVersion': '1.8.0_181', - 'lastSnapshottedMilestoneIndex': 434525, - 'latestMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestMilestoneIndex': 1313715, - 'latestSolidSubtangleMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestSolidSubtangleMilestoneIndex': 1313715, - 'milestoneStartIndex': 434527, - 'neighbors': 3, - 'packetsQueueSize': 0, - 'time': 1565638086467, - 'tips': 733, - 'transactionsToRequest': 0} +$ python3 +>>>from sense_hat import SenseHat +>>>sense = SenseHat() +>>>sense.show_message("Hello Sense Hat") ``` -[Running in headless mode](Headless.md) +The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiQuake emulator + +To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) + +## Optional: running AstroPiQuake in headless mode + +[Running AstroPiQuake in headless mode](Headless.md) diff --git a/folder/es/README.md b/folder/es/README.md index a8776fd..c50f194 100644 --- a/folder/es/README.md +++ b/folder/es/README.md @@ -1,22 +1,14 @@ -## AstroPiOTA +## AstroPiQuake -You can sense environment data using SenseHat and Raspberry Pi You can store the data on the Tangle or sell it on data marketplaces such as [I3 Marketplace](http://ec2-18-217-227-236.us-east-2.compute.amazonaws.com:8000/). +AstroPiQuake gathers environment data using SenseHat and Raspberry Pi -AstroPiOTA is a clone of AstroPi that connects to the IOTA Tangle. That's why it's called AstroPiOTA! The Tangle is a distributed ledger useful for storing and sharing data. +[AstroPi](https://www.nasa.gov/mission_pages/station/research/experiments/explorer/Investigation.html?#id=7534) flies onboard the International Space Station (ISS) keeping astronauts update-to-date about their environment. Here on Earth, you can monitor your local environment data and detect earthquakes using a clone of AstroPi called "AstroPiQuake" -[AstroPi](https://www.nasa.gov/mission_pages/station/research/experiments/2429.html) flies onboard the International Space Station (ISS) keeping astronauts update-to-date about their environment. Here on Earth, you can monitor your local environment data and store it on the Tangle. - -Try out the [AstroPiOTA emulator](http://www.nelsontech.blog/I3/Phase1/AstroPiOTAemulator-Smiley.htm). Move the temperature slider to see Smiley's face change colors from cool blue to mellow yellow to red hot. Take a look at [earthquake detection](http://www.nelsontech.blog/I3/Phase1/AstroPiOTAemulator-Earthquake.htm). Grab AstroPiOTA with your mouse and move it. Watch the graph change as it detects you simulating an earthquake. +Try out the [AstroPiQuake emulator](https://trinket.io/python/9c2e984979). Move the temperature slider to see Smiley's face change colors from cool blue to mellow yellow to red hot. Take a look at [earthquake detection](https://trinket.io/python/86417fad20). Grab AstroPiQuake with your mouse and shake it. Watch the graph change as it detects you simulating an earthquake. ### Sensing environment data -Sense Hat has an IMU or Inertial Measurement Unit with these [specifications](SenseHatSpecs.md): - -- Temperature and humidity sensors -- Barometric Pressure sensor -- Accelerometer that measures acceleration forces -- Gyroscope that measures momentum and rotation -- Magnetometer that measures the Earth’s own magnetic field, a bit like a compass +Sense Hat has temperature and humidity sensors. It can sense the barometric pressure. It has an IMU or Inertial Measurement Unit with an accelerometer that measures acceleration forces, a gyroscope that measures momentum and rotation, and a magnetometer that measures the Earth’s own magnetic field, similar to a compass. Here are the [technical specifications](SenseHatSpecs.md). Accelerometer and gyroscope data are measured using [coordinates](https://en.wikipedia.org/wiki/Euler_angles). These are sometimes referred to as yaw, pitch, and roll. @@ -25,42 +17,27 @@ Accelerometer and gyroscope data are measured using [coordinates](https://en.wik z is roll or rotation about the z-axis -## Building your own AstroPiOTA - -[Building the environment sensor](BuildIT.md) - -[Installing software and configuring your device](InstallIT.md) - -[Running in headless mode](Headless.md) +## Building your own AstroPiQuake -## Using your data +[Building your own AstroPiQuake environment sensor](BuildIT.md) -You can store your data directly to the Tangle +[Configuring AstroPiQuake and installing software](InstallIT.md) -[Storing data directly to the Tangle](direct2Tangle.md) +[Optional: running AstroPiQuake in headless mode](Headless.md) -[Viewing data using the Devnet Tangle Explorer](https://devnet.thetangle.org/) +## Gathering data -[Retrieving data using ZMQ](https://github.com/NelsonPython/IoT-ZMQ-listener/blob/master/README.md) +Watching sensor readings - -## Selling your data -You sell data by publishing it on the I3 Marketplace where subscribers can buy it: - -[Publishing data to I3 Data Marketplace](I3-publish.md) - -[Retrieving your data subscription](I3-subscribe.md) +Saving sensor data in a MySQL table ## Investigating your data -[Getting starting with the AstroPiOTA notebook on Kaggle](https://www.kaggle.com/nelsondata/astropiota-weather-los-angeles) - -[Charting your data on ThingSpeak](https://thingspeak.com/channels/865101) +[Charting your AstroPiQuake data on ThingSpeak](https://thingspeak.com/channels/865101) -## Learning as we go +## Experimenting -- Seeds are only needed for sending value transactions +[Broadcasting messages onboard an AV](https://github.com/NelsonPython/DriveI5) -- As of October 2019, Raspberry Pi Buster operating system appears to have a WiFi Bug. You may want to use Stretch until a solution is found. Learn more: https://www.raspberrypi.org/forums/viewtopic.php?t=252984 +[Detecting earthquakes](https://www.kaggle.com/nelsondata/confirming-earthquake-detection) -- This tutorial has not been tested with Python 3.7 diff --git a/folder/es/viewAstroPiQuake.md b/folder/es/viewAstroPiQuake.md new file mode 100644 index 0000000..647fa50 --- /dev/null +++ b/folder/es/viewAstroPiQuake.md @@ -0,0 +1,43 @@ +

Viewing AstroPiQuake sensor data

+ +AstroPiQuake senses temperature, humidity, and pressure. It gets gyroscope and accelerometer readings. + +This getData.py script senses data and prints it in json format + +``` +#!/usr/bin/python + +import datetime +from sense_hat import SenseHat + +sense = SenseHat() + +sensors = {} +sensors["pressure"] = str(sense.get_pressure()) +sensors["temperature"] = str(sense.get_temperature()) +sensors["humidity"] = str(sense.get_humidity()) + +o = sense.get_orientation() +sensors["pitch"] = str(o["pitch"]) +sensors["roll"] = str(o["roll"]) +sensors["yaw"] = str(o["yaw"]) + +a = sense.get_accelerometer_raw() +sensors["x"] = str(a["x"]) +sensors["y"] = str(a["y"]) +sensors["z"] = str(a["z"]) + +t = datetime.datetime.now() +sensors["timestamp"] = str(t.strftime('%Y%m%d %H:%M')) +sensors["lng"] = '-118.323411' +sensors["lat"] = '33.893916' +sensors["device_name"] = "AstroPiQuake" + +print(sensors) +``` + +

json

+ +``` +{'pressure': '0', 'lat': '33.893916', 'z': '-0.02169257216155529', 'pitch': '2.6417886780271713', 'roll': '281.7232590548508', 'yaw': '134.7106325472459', 'lng': '-118.323411', 'y': '-0.972381591796875', 'humidity': '39.247840881347656', 'device_name': 'AstroPiQuake', 'x': '-0.0034556991886347532', 'timestamp': '20200528 12:31', 'temperature': '31.669998168945312'} +``` diff --git a/folder/fr/BuildIT.md b/folder/fr/BuildIT.md index bd71c91..dc8763b 100644 --- a/folder/fr/BuildIT.md +++ b/folder/fr/BuildIT.md @@ -1,14 +1,15 @@ -# Building an environment sensor - -To build your own AstroPiOTA environment sensor, you need a SenseHat,a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB) +# Building your own AstroPiQuake environment sensor +

Sense HAT version 1.0
+
+ +
Raspberry Pi 3 B
+
-###
Raspberry Pi 3 B
- -Get the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Don't use a Raspberry Pi 3 B+ (B plus) because it has pins that prevent attaching Sense HAT version 1.0** +Buy a SenseHat, a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB). I used SenseHat version 1.0 and the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Make sure the pins on SenseHat line up with the Raspberry Pi. For example, a Raspberry Pi 3 B+ (B plus) has pins that prevent attaching Sense HAT version 1.0** ### Connecting SenseHat @@ -28,6 +29,6 @@ You can connect remotely using Secure Shell (SSH). First, you must enable SSH. ![Window for enabling SSH as described in text](images/SSH.png) -### Installing software +## Configuring AstroPiQuake and installing software -[Install AstroPiOTA Software](InstallIT.md) +[Configuring AstroPiQuake and installing software](InstallIT.md) diff --git a/folder/fr/Headless.md b/folder/fr/Headless.md index 93dff57..f55a82c 100644 --- a/folder/fr/Headless.md +++ b/folder/fr/Headless.md @@ -1,6 +1,6 @@ -# Running in headless mode (optional) +# Running AstroPiQuake in headless mode -If you plan to run AstroPiOTA without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. Configure a cron job so Raspberry Pi runs this script at every reboot. +If you plan to run AstroPiQuake without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. You can configure a cron job so Raspberry Pi runs this script every time your boot. ### Getting the IP address @@ -20,7 +20,7 @@ sense = SenseHat() def getIP(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: - s.connect(('192.168.255.255',1)) #lab network used for this example + s.connect(('192.168.255.255',1)) IP = s.getsockname()[0] except: IP = '127.0.0.1' @@ -47,7 +47,7 @@ python3 senseIP.py ![Screen capture of shell script described in text](images/RasSenseIP.png) -Save the schell script then reset the permissions +Save the schell script then set the permissions to add permission to eXecute the script ``` sudo chmod +x senseBoot.sh @@ -68,10 +68,11 @@ Add this command at the bottom Unplug monitor, keyboard, and mouse, then reboot Raspberry Pi. Wait a second or two, then watch the IP address scrolling across the Sense HAT LED screen. -Take a look at the AstroPiOTA emulator - Now you can connect to Raspberry Pi using SSH. When you want to shutdown, type: ``` sudo shutdown now ``` + ## Using your AstroPiQuake + + [AstroPiQuake](https://github.com/NelsonPython/AstroPiQuake) diff --git a/folder/fr/InstallIT.md b/folder/fr/InstallIT.md index 8b213cf..0f8dce5 100644 --- a/folder/fr/InstallIT.md +++ b/folder/fr/InstallIT.md @@ -1,19 +1,13 @@ -# Installing software and configuring your device +# Configuring AstroPiQuake and installing software -First, you must configure your Raspberry Pi. Next, install the SenseHat drivers. Finally, install the IOTA Python client library, IOTA Python Workshop, and copy the AstroPiOTA scripts. - -## Configuring Raspberry Pi - -When connecting directly the first time, Raspberry Pi will automatically boot with the default user and password: +When connecting directly the first time, Raspberry Pi will automatically boot with the default username and password: ``` Default username: pi Default password: raspberry ``` -Using the Raspberry Pi Configuration tool, set the keyboard mapping to USA English. Otherwise, you will be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. - -Click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. +It will also expect you to use a British keyboard. You may be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. To change the keyboard settings, click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. ![RasPi configuration window as described in text](images/Localisation.png) @@ -21,35 +15,16 @@ Set your Locale, Timezone, and WiFi country. Then, click on the `Set Keyboard.. ![Window for setting localisation as described in text](images/localisation2.png) -Select `United States -> English (US)` - -## Installing Sense HAT - -Install Sense Hat: - -``` -sudo apt-get update -sudo apt-get install sense-hat -sudo pip-3.2 install pillow -``` -See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information - -For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen: +Select `United States -> English (US)` -``` -$ python3 ->>>from sense_hat import SenseHat ->>>sense = SenseHat() ->>>sense.show_message("Hello Sense Hat") -``` +Known bugs -The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiOTA emulator +- As of October 2019, Raspberry Pi Buster operating system may have a WiFi Bug: https://www.raspberrypi.org/forums/viewtopic.php?t=252984 -To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) -## Verifying the version of Python +## Verifying your version of Python -Verify that Python3 has been pre-installed: +Different Raspberry Pi operating systems ship with different versions of Python and Pip. Verify that Python3 has been pre-installed: ``` python3 --version @@ -63,42 +38,30 @@ $ pip 18.0 from /usr/local/lib/python3.4/dist-packages/pip-18.0-py3.4.egg/pip ( Note: This tutorial has not been tested using Python 3.6 or 3.7 -## Installing the [Python IOTA Workshop scripts](https://github.com/iota-community/python-iota-workshop) +## Installing Sense HAT software -This installs the Pyota client library so you can communicate with the [Tangle](https://docs.iota.org/docs/dev-essentials/0.1/concepts/the-tangle). The workshop includes a step-by-step tutorial teaching the details of sending and receiving transactions to the Tangle. They provide the foundation for the code used to store sensor data from AstroPiOTA. +Install Sense Hat: -Clone the github repository, install the workshop code, and run the "hello world" example. ``` -git clone https://github.com/iota-community/python-iota-workshop.git -cd python-iota-workshop -pip3 install -r requirements.txt -python3 code/e01_hello_world.py +sudo apt-get update +sudo apt-get install sense-hat +sudo pip3 install pillow ``` +See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information -The Tangle will respond with the latest statistics: +For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen. Follow these commands: ``` -{'appName': 'IRI Testnet', - 'appVersion': '1.8.0-RC1', - 'coordinatorAddress': 'EQQFCZBIHRHWPXKMTOLMYUYPCN9XLMJPYZVFJSAY9FQHCCLWTOLLUGKKMXYFDBOOYFBLBI9WUEILGECYM', - 'duration': 0, - 'features': ['dnsRefresher', 'testnet', 'zeroMessageQueue', 'RemotePOW'], - 'jreAvailableProcessors': 8, - 'jreFreeMemory': 14557498488, - 'jreMaxMemory': 22906667008, - 'jreTotalMemory': 16883646464, - 'jreVersion': '1.8.0_181', - 'lastSnapshottedMilestoneIndex': 434525, - 'latestMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestMilestoneIndex': 1313715, - 'latestSolidSubtangleMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestSolidSubtangleMilestoneIndex': 1313715, - 'milestoneStartIndex': 434527, - 'neighbors': 3, - 'packetsQueueSize': 0, - 'time': 1565638086467, - 'tips': 733, - 'transactionsToRequest': 0} +$ python3 +>>>from sense_hat import SenseHat +>>>sense = SenseHat() +>>>sense.show_message("Hello Sense Hat") ``` -[Running in headless mode](Headless.md) +The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiQuake emulator + +To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) + +## Optional: running AstroPiQuake in headless mode + +[Running AstroPiQuake in headless mode](Headless.md) diff --git a/folder/fr/README.md b/folder/fr/README.md index a8776fd..c50f194 100644 --- a/folder/fr/README.md +++ b/folder/fr/README.md @@ -1,22 +1,14 @@ -## AstroPiOTA +## AstroPiQuake -You can sense environment data using SenseHat and Raspberry Pi You can store the data on the Tangle or sell it on data marketplaces such as [I3 Marketplace](http://ec2-18-217-227-236.us-east-2.compute.amazonaws.com:8000/). +AstroPiQuake gathers environment data using SenseHat and Raspberry Pi -AstroPiOTA is a clone of AstroPi that connects to the IOTA Tangle. That's why it's called AstroPiOTA! The Tangle is a distributed ledger useful for storing and sharing data. +[AstroPi](https://www.nasa.gov/mission_pages/station/research/experiments/explorer/Investigation.html?#id=7534) flies onboard the International Space Station (ISS) keeping astronauts update-to-date about their environment. Here on Earth, you can monitor your local environment data and detect earthquakes using a clone of AstroPi called "AstroPiQuake" -[AstroPi](https://www.nasa.gov/mission_pages/station/research/experiments/2429.html) flies onboard the International Space Station (ISS) keeping astronauts update-to-date about their environment. Here on Earth, you can monitor your local environment data and store it on the Tangle. - -Try out the [AstroPiOTA emulator](http://www.nelsontech.blog/I3/Phase1/AstroPiOTAemulator-Smiley.htm). Move the temperature slider to see Smiley's face change colors from cool blue to mellow yellow to red hot. Take a look at [earthquake detection](http://www.nelsontech.blog/I3/Phase1/AstroPiOTAemulator-Earthquake.htm). Grab AstroPiOTA with your mouse and move it. Watch the graph change as it detects you simulating an earthquake. +Try out the [AstroPiQuake emulator](https://trinket.io/python/9c2e984979). Move the temperature slider to see Smiley's face change colors from cool blue to mellow yellow to red hot. Take a look at [earthquake detection](https://trinket.io/python/86417fad20). Grab AstroPiQuake with your mouse and shake it. Watch the graph change as it detects you simulating an earthquake. ### Sensing environment data -Sense Hat has an IMU or Inertial Measurement Unit with these [specifications](SenseHatSpecs.md): - -- Temperature and humidity sensors -- Barometric Pressure sensor -- Accelerometer that measures acceleration forces -- Gyroscope that measures momentum and rotation -- Magnetometer that measures the Earth’s own magnetic field, a bit like a compass +Sense Hat has temperature and humidity sensors. It can sense the barometric pressure. It has an IMU or Inertial Measurement Unit with an accelerometer that measures acceleration forces, a gyroscope that measures momentum and rotation, and a magnetometer that measures the Earth’s own magnetic field, similar to a compass. Here are the [technical specifications](SenseHatSpecs.md). Accelerometer and gyroscope data are measured using [coordinates](https://en.wikipedia.org/wiki/Euler_angles). These are sometimes referred to as yaw, pitch, and roll. @@ -25,42 +17,27 @@ Accelerometer and gyroscope data are measured using [coordinates](https://en.wik z is roll or rotation about the z-axis -## Building your own AstroPiOTA - -[Building the environment sensor](BuildIT.md) - -[Installing software and configuring your device](InstallIT.md) - -[Running in headless mode](Headless.md) +## Building your own AstroPiQuake -## Using your data +[Building your own AstroPiQuake environment sensor](BuildIT.md) -You can store your data directly to the Tangle +[Configuring AstroPiQuake and installing software](InstallIT.md) -[Storing data directly to the Tangle](direct2Tangle.md) +[Optional: running AstroPiQuake in headless mode](Headless.md) -[Viewing data using the Devnet Tangle Explorer](https://devnet.thetangle.org/) +## Gathering data -[Retrieving data using ZMQ](https://github.com/NelsonPython/IoT-ZMQ-listener/blob/master/README.md) +Watching sensor readings - -## Selling your data -You sell data by publishing it on the I3 Marketplace where subscribers can buy it: - -[Publishing data to I3 Data Marketplace](I3-publish.md) - -[Retrieving your data subscription](I3-subscribe.md) +Saving sensor data in a MySQL table ## Investigating your data -[Getting starting with the AstroPiOTA notebook on Kaggle](https://www.kaggle.com/nelsondata/astropiota-weather-los-angeles) - -[Charting your data on ThingSpeak](https://thingspeak.com/channels/865101) +[Charting your AstroPiQuake data on ThingSpeak](https://thingspeak.com/channels/865101) -## Learning as we go +## Experimenting -- Seeds are only needed for sending value transactions +[Broadcasting messages onboard an AV](https://github.com/NelsonPython/DriveI5) -- As of October 2019, Raspberry Pi Buster operating system appears to have a WiFi Bug. You may want to use Stretch until a solution is found. Learn more: https://www.raspberrypi.org/forums/viewtopic.php?t=252984 +[Detecting earthquakes](https://www.kaggle.com/nelsondata/confirming-earthquake-detection) -- This tutorial has not been tested with Python 3.7 diff --git a/folder/fr/viewAstroPiQuake.md b/folder/fr/viewAstroPiQuake.md new file mode 100644 index 0000000..647fa50 --- /dev/null +++ b/folder/fr/viewAstroPiQuake.md @@ -0,0 +1,43 @@ +

Viewing AstroPiQuake sensor data

+ +AstroPiQuake senses temperature, humidity, and pressure. It gets gyroscope and accelerometer readings. + +This getData.py script senses data and prints it in json format + +``` +#!/usr/bin/python + +import datetime +from sense_hat import SenseHat + +sense = SenseHat() + +sensors = {} +sensors["pressure"] = str(sense.get_pressure()) +sensors["temperature"] = str(sense.get_temperature()) +sensors["humidity"] = str(sense.get_humidity()) + +o = sense.get_orientation() +sensors["pitch"] = str(o["pitch"]) +sensors["roll"] = str(o["roll"]) +sensors["yaw"] = str(o["yaw"]) + +a = sense.get_accelerometer_raw() +sensors["x"] = str(a["x"]) +sensors["y"] = str(a["y"]) +sensors["z"] = str(a["z"]) + +t = datetime.datetime.now() +sensors["timestamp"] = str(t.strftime('%Y%m%d %H:%M')) +sensors["lng"] = '-118.323411' +sensors["lat"] = '33.893916' +sensors["device_name"] = "AstroPiQuake" + +print(sensors) +``` + +

json

+ +``` +{'pressure': '0', 'lat': '33.893916', 'z': '-0.02169257216155529', 'pitch': '2.6417886780271713', 'roll': '281.7232590548508', 'yaw': '134.7106325472459', 'lng': '-118.323411', 'y': '-0.972381591796875', 'humidity': '39.247840881347656', 'device_name': 'AstroPiQuake', 'x': '-0.0034556991886347532', 'timestamp': '20200528 12:31', 'temperature': '31.669998168945312'} +``` diff --git a/folder/ru/BuildIT.md b/folder/ru/BuildIT.md index bd71c91..dc8763b 100644 --- a/folder/ru/BuildIT.md +++ b/folder/ru/BuildIT.md @@ -1,14 +1,15 @@ -# Building an environment sensor - -To build your own AstroPiOTA environment sensor, you need a SenseHat,a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB) +# Building your own AstroPiQuake environment sensor +

Sense HAT version 1.0
+
+ +
Raspberry Pi 3 B
+
-###
Raspberry Pi 3 B
- -Get the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Don't use a Raspberry Pi 3 B+ (B plus) because it has pins that prevent attaching Sense HAT version 1.0** +Buy a SenseHat, a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB). I used SenseHat version 1.0 and the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Make sure the pins on SenseHat line up with the Raspberry Pi. For example, a Raspberry Pi 3 B+ (B plus) has pins that prevent attaching Sense HAT version 1.0** ### Connecting SenseHat @@ -28,6 +29,6 @@ You can connect remotely using Secure Shell (SSH). First, you must enable SSH. ![Window for enabling SSH as described in text](images/SSH.png) -### Installing software +## Configuring AstroPiQuake and installing software -[Install AstroPiOTA Software](InstallIT.md) +[Configuring AstroPiQuake and installing software](InstallIT.md) diff --git a/folder/ru/Headless.md b/folder/ru/Headless.md index 93dff57..f55a82c 100644 --- a/folder/ru/Headless.md +++ b/folder/ru/Headless.md @@ -1,6 +1,6 @@ -# Running in headless mode (optional) +# Running AstroPiQuake in headless mode -If you plan to run AstroPiOTA without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. Configure a cron job so Raspberry Pi runs this script at every reboot. +If you plan to run AstroPiQuake without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. You can configure a cron job so Raspberry Pi runs this script every time your boot. ### Getting the IP address @@ -20,7 +20,7 @@ sense = SenseHat() def getIP(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: - s.connect(('192.168.255.255',1)) #lab network used for this example + s.connect(('192.168.255.255',1)) IP = s.getsockname()[0] except: IP = '127.0.0.1' @@ -47,7 +47,7 @@ python3 senseIP.py ![Screen capture of shell script described in text](images/RasSenseIP.png) -Save the schell script then reset the permissions +Save the schell script then set the permissions to add permission to eXecute the script ``` sudo chmod +x senseBoot.sh @@ -68,10 +68,11 @@ Add this command at the bottom Unplug monitor, keyboard, and mouse, then reboot Raspberry Pi. Wait a second or two, then watch the IP address scrolling across the Sense HAT LED screen. -Take a look at the AstroPiOTA emulator - Now you can connect to Raspberry Pi using SSH. When you want to shutdown, type: ``` sudo shutdown now ``` + ## Using your AstroPiQuake + + [AstroPiQuake](https://github.com/NelsonPython/AstroPiQuake) diff --git a/folder/ru/InstallIT.md b/folder/ru/InstallIT.md index 8b213cf..0f8dce5 100644 --- a/folder/ru/InstallIT.md +++ b/folder/ru/InstallIT.md @@ -1,19 +1,13 @@ -# Installing software and configuring your device +# Configuring AstroPiQuake and installing software -First, you must configure your Raspberry Pi. Next, install the SenseHat drivers. Finally, install the IOTA Python client library, IOTA Python Workshop, and copy the AstroPiOTA scripts. - -## Configuring Raspberry Pi - -When connecting directly the first time, Raspberry Pi will automatically boot with the default user and password: +When connecting directly the first time, Raspberry Pi will automatically boot with the default username and password: ``` Default username: pi Default password: raspberry ``` -Using the Raspberry Pi Configuration tool, set the keyboard mapping to USA English. Otherwise, you will be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. - -Click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. +It will also expect you to use a British keyboard. You may be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. To change the keyboard settings, click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. ![RasPi configuration window as described in text](images/Localisation.png) @@ -21,35 +15,16 @@ Set your Locale, Timezone, and WiFi country. Then, click on the `Set Keyboard.. ![Window for setting localisation as described in text](images/localisation2.png) -Select `United States -> English (US)` - -## Installing Sense HAT - -Install Sense Hat: - -``` -sudo apt-get update -sudo apt-get install sense-hat -sudo pip-3.2 install pillow -``` -See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information - -For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen: +Select `United States -> English (US)` -``` -$ python3 ->>>from sense_hat import SenseHat ->>>sense = SenseHat() ->>>sense.show_message("Hello Sense Hat") -``` +Known bugs -The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiOTA emulator +- As of October 2019, Raspberry Pi Buster operating system may have a WiFi Bug: https://www.raspberrypi.org/forums/viewtopic.php?t=252984 -To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) -## Verifying the version of Python +## Verifying your version of Python -Verify that Python3 has been pre-installed: +Different Raspberry Pi operating systems ship with different versions of Python and Pip. Verify that Python3 has been pre-installed: ``` python3 --version @@ -63,42 +38,30 @@ $ pip 18.0 from /usr/local/lib/python3.4/dist-packages/pip-18.0-py3.4.egg/pip ( Note: This tutorial has not been tested using Python 3.6 or 3.7 -## Installing the [Python IOTA Workshop scripts](https://github.com/iota-community/python-iota-workshop) +## Installing Sense HAT software -This installs the Pyota client library so you can communicate with the [Tangle](https://docs.iota.org/docs/dev-essentials/0.1/concepts/the-tangle). The workshop includes a step-by-step tutorial teaching the details of sending and receiving transactions to the Tangle. They provide the foundation for the code used to store sensor data from AstroPiOTA. +Install Sense Hat: -Clone the github repository, install the workshop code, and run the "hello world" example. ``` -git clone https://github.com/iota-community/python-iota-workshop.git -cd python-iota-workshop -pip3 install -r requirements.txt -python3 code/e01_hello_world.py +sudo apt-get update +sudo apt-get install sense-hat +sudo pip3 install pillow ``` +See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information -The Tangle will respond with the latest statistics: +For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen. Follow these commands: ``` -{'appName': 'IRI Testnet', - 'appVersion': '1.8.0-RC1', - 'coordinatorAddress': 'EQQFCZBIHRHWPXKMTOLMYUYPCN9XLMJPYZVFJSAY9FQHCCLWTOLLUGKKMXYFDBOOYFBLBI9WUEILGECYM', - 'duration': 0, - 'features': ['dnsRefresher', 'testnet', 'zeroMessageQueue', 'RemotePOW'], - 'jreAvailableProcessors': 8, - 'jreFreeMemory': 14557498488, - 'jreMaxMemory': 22906667008, - 'jreTotalMemory': 16883646464, - 'jreVersion': '1.8.0_181', - 'lastSnapshottedMilestoneIndex': 434525, - 'latestMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestMilestoneIndex': 1313715, - 'latestSolidSubtangleMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestSolidSubtangleMilestoneIndex': 1313715, - 'milestoneStartIndex': 434527, - 'neighbors': 3, - 'packetsQueueSize': 0, - 'time': 1565638086467, - 'tips': 733, - 'transactionsToRequest': 0} +$ python3 +>>>from sense_hat import SenseHat +>>>sense = SenseHat() +>>>sense.show_message("Hello Sense Hat") ``` -[Running in headless mode](Headless.md) +The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiQuake emulator + +To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) + +## Optional: running AstroPiQuake in headless mode + +[Running AstroPiQuake in headless mode](Headless.md) diff --git a/folder/ru/README.md b/folder/ru/README.md index aa8d2bd..c50f194 100644 --- a/folder/ru/README.md +++ b/folder/ru/README.md @@ -1 +1,43 @@ -Language translations from Crowdin +## AstroPiQuake + +AstroPiQuake gathers environment data using SenseHat and Raspberry Pi + +[AstroPi](https://www.nasa.gov/mission_pages/station/research/experiments/explorer/Investigation.html?#id=7534) flies onboard the International Space Station (ISS) keeping astronauts update-to-date about their environment. Here on Earth, you can monitor your local environment data and detect earthquakes using a clone of AstroPi called "AstroPiQuake" + +Try out the [AstroPiQuake emulator](https://trinket.io/python/9c2e984979). Move the temperature slider to see Smiley's face change colors from cool blue to mellow yellow to red hot. Take a look at [earthquake detection](https://trinket.io/python/86417fad20). Grab AstroPiQuake with your mouse and shake it. Watch the graph change as it detects you simulating an earthquake. + +### Sensing environment data + +Sense Hat has temperature and humidity sensors. It can sense the barometric pressure. It has an IMU or Inertial Measurement Unit with an accelerometer that measures acceleration forces, a gyroscope that measures momentum and rotation, and a magnetometer that measures the Earth’s own magnetic field, similar to a compass. Here are the [technical specifications](SenseHatSpecs.md). + +Accelerometer and gyroscope data are measured using [coordinates](https://en.wikipedia.org/wiki/Euler_angles). These are sometimes referred to as yaw, pitch, and roll. + + x is yaw or rotation about the x-axis + y is pitch or rotation about the y-axis + z is roll or rotation about the z-axis + + +## Building your own AstroPiQuake + +[Building your own AstroPiQuake environment sensor](BuildIT.md) + +[Configuring AstroPiQuake and installing software](InstallIT.md) + +[Optional: running AstroPiQuake in headless mode](Headless.md) + +## Gathering data + +Watching sensor readings + +Saving sensor data in a MySQL table + +## Investigating your data + +[Charting your AstroPiQuake data on ThingSpeak](https://thingspeak.com/channels/865101) + +## Experimenting + +[Broadcasting messages onboard an AV](https://github.com/NelsonPython/DriveI5) + +[Detecting earthquakes](https://www.kaggle.com/nelsondata/confirming-earthquake-detection) + diff --git a/folder/ru/viewAstroPiQuake.md b/folder/ru/viewAstroPiQuake.md new file mode 100644 index 0000000..647fa50 --- /dev/null +++ b/folder/ru/viewAstroPiQuake.md @@ -0,0 +1,43 @@ +

Viewing AstroPiQuake sensor data

+ +AstroPiQuake senses temperature, humidity, and pressure. It gets gyroscope and accelerometer readings. + +This getData.py script senses data and prints it in json format + +``` +#!/usr/bin/python + +import datetime +from sense_hat import SenseHat + +sense = SenseHat() + +sensors = {} +sensors["pressure"] = str(sense.get_pressure()) +sensors["temperature"] = str(sense.get_temperature()) +sensors["humidity"] = str(sense.get_humidity()) + +o = sense.get_orientation() +sensors["pitch"] = str(o["pitch"]) +sensors["roll"] = str(o["roll"]) +sensors["yaw"] = str(o["yaw"]) + +a = sense.get_accelerometer_raw() +sensors["x"] = str(a["x"]) +sensors["y"] = str(a["y"]) +sensors["z"] = str(a["z"]) + +t = datetime.datetime.now() +sensors["timestamp"] = str(t.strftime('%Y%m%d %H:%M')) +sensors["lng"] = '-118.323411' +sensors["lat"] = '33.893916' +sensors["device_name"] = "AstroPiQuake" + +print(sensors) +``` + +

json

+ +``` +{'pressure': '0', 'lat': '33.893916', 'z': '-0.02169257216155529', 'pitch': '2.6417886780271713', 'roll': '281.7232590548508', 'yaw': '134.7106325472459', 'lng': '-118.323411', 'y': '-0.972381591796875', 'humidity': '39.247840881347656', 'device_name': 'AstroPiQuake', 'x': '-0.0034556991886347532', 'timestamp': '20200528 12:31', 'temperature': '31.669998168945312'} +``` diff --git a/folder/zh/BuildIT.md b/folder/zh/BuildIT.md index bd71c91..dc8763b 100644 --- a/folder/zh/BuildIT.md +++ b/folder/zh/BuildIT.md @@ -1,14 +1,15 @@ -# Building an environment sensor - -To build your own AstroPiOTA environment sensor, you need a SenseHat,a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB) +# Building your own AstroPiQuake environment sensor +

Sense HAT version 1.0
+
+ +
Raspberry Pi 3 B
+
-###
Raspberry Pi 3 B
- -Get the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Don't use a Raspberry Pi 3 B+ (B plus) because it has pins that prevent attaching Sense HAT version 1.0** +Buy a SenseHat, a Raspberry Pi, and some [nylon screws](https://www.adafruit.com/product/3658?gclid=Cj0KCQjwv8nqBRDGARIsAHfR9wBwaHbR4DYYvKNhYAOkW7qpPTJ8V0WQmaBEX2qkbu46yzPmv3Xd8qcaAnL5EALw_wcB). I used SenseHat version 1.0 and the [Raspberry Pi 3 Model B Starter Pack]() that includes an SD Memory Card with Raspbian pre-installed. **Make sure the pins on SenseHat line up with the Raspberry Pi. For example, a Raspberry Pi 3 B+ (B plus) has pins that prevent attaching Sense HAT version 1.0** ### Connecting SenseHat @@ -28,6 +29,6 @@ You can connect remotely using Secure Shell (SSH). First, you must enable SSH. ![Window for enabling SSH as described in text](images/SSH.png) -### Installing software +## Configuring AstroPiQuake and installing software -[Install AstroPiOTA Software](InstallIT.md) +[Configuring AstroPiQuake and installing software](InstallIT.md) diff --git a/folder/zh/Headless.md b/folder/zh/Headless.md index 93dff57..f55a82c 100644 --- a/folder/zh/Headless.md +++ b/folder/zh/Headless.md @@ -1,6 +1,6 @@ -# Running in headless mode (optional) +# Running AstroPiQuake in headless mode -If you plan to run AstroPiOTA without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. Configure a cron job so Raspberry Pi runs this script at every reboot. +If you plan to run AstroPiQuake without a monitor and keyboard, you need it's network address to interact with it over SSH. This can be tricky. One method that works pretty well, is creating a script to retrieve the Raspberry Pi IP address at boot and print it on a scrolling marquee across the Sense HAT LED screen. You can configure a cron job so Raspberry Pi runs this script every time your boot. ### Getting the IP address @@ -20,7 +20,7 @@ sense = SenseHat() def getIP(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: - s.connect(('192.168.255.255',1)) #lab network used for this example + s.connect(('192.168.255.255',1)) IP = s.getsockname()[0] except: IP = '127.0.0.1' @@ -47,7 +47,7 @@ python3 senseIP.py ![Screen capture of shell script described in text](images/RasSenseIP.png) -Save the schell script then reset the permissions +Save the schell script then set the permissions to add permission to eXecute the script ``` sudo chmod +x senseBoot.sh @@ -68,10 +68,11 @@ Add this command at the bottom Unplug monitor, keyboard, and mouse, then reboot Raspberry Pi. Wait a second or two, then watch the IP address scrolling across the Sense HAT LED screen. -Take a look at the AstroPiOTA emulator - Now you can connect to Raspberry Pi using SSH. When you want to shutdown, type: ``` sudo shutdown now ``` + ## Using your AstroPiQuake + + [AstroPiQuake](https://github.com/NelsonPython/AstroPiQuake) diff --git a/folder/zh/InstallIT.md b/folder/zh/InstallIT.md index 8b213cf..0f8dce5 100644 --- a/folder/zh/InstallIT.md +++ b/folder/zh/InstallIT.md @@ -1,19 +1,13 @@ -# Installing software and configuring your device +# Configuring AstroPiQuake and installing software -First, you must configure your Raspberry Pi. Next, install the SenseHat drivers. Finally, install the IOTA Python client library, IOTA Python Workshop, and copy the AstroPiOTA scripts. - -## Configuring Raspberry Pi - -When connecting directly the first time, Raspberry Pi will automatically boot with the default user and password: +When connecting directly the first time, Raspberry Pi will automatically boot with the default username and password: ``` Default username: pi Default password: raspberry ``` -Using the Raspberry Pi Configuration tool, set the keyboard mapping to USA English. Otherwise, you will be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. - -Click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. +It will also expect you to use a British keyboard. You may be surprised when installation commands fail because the pipe symbol `|` is mapped to `~`. To change the keyboard settings, click the raspberry icon on the menu, select `Preferences`, then select `Raspberry Pi Configuration`. Click on the `Localisation` tab. ![RasPi configuration window as described in text](images/Localisation.png) @@ -21,35 +15,16 @@ Set your Locale, Timezone, and WiFi country. Then, click on the `Set Keyboard.. ![Window for setting localisation as described in text](images/localisation2.png) -Select `United States -> English (US)` - -## Installing Sense HAT - -Install Sense Hat: - -``` -sudo apt-get update -sudo apt-get install sense-hat -sudo pip-3.2 install pillow -``` -See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information - -For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen: +Select `United States -> English (US)` -``` -$ python3 ->>>from sense_hat import SenseHat ->>>sense = SenseHat() ->>>sense.show_message("Hello Sense Hat") -``` +Known bugs -The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiOTA emulator +- As of October 2019, Raspberry Pi Buster operating system may have a WiFi Bug: https://www.raspberrypi.org/forums/viewtopic.php?t=252984 -To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) -## Verifying the version of Python +## Verifying your version of Python -Verify that Python3 has been pre-installed: +Different Raspberry Pi operating systems ship with different versions of Python and Pip. Verify that Python3 has been pre-installed: ``` python3 --version @@ -63,42 +38,30 @@ $ pip 18.0 from /usr/local/lib/python3.4/dist-packages/pip-18.0-py3.4.egg/pip ( Note: This tutorial has not been tested using Python 3.6 or 3.7 -## Installing the [Python IOTA Workshop scripts](https://github.com/iota-community/python-iota-workshop) +## Installing Sense HAT software -This installs the Pyota client library so you can communicate with the [Tangle](https://docs.iota.org/docs/dev-essentials/0.1/concepts/the-tangle). The workshop includes a step-by-step tutorial teaching the details of sending and receiving transactions to the Tangle. They provide the foundation for the code used to store sensor data from AstroPiOTA. +Install Sense Hat: -Clone the github repository, install the workshop code, and run the "hello world" example. ``` -git clone https://github.com/iota-community/python-iota-workshop.git -cd python-iota-workshop -pip3 install -r requirements.txt -python3 code/e01_hello_world.py +sudo apt-get update +sudo apt-get install sense-hat +sudo pip3 install pillow ``` +See the [driver documentation](https://pythonhosted.org/sense-hat/) for more information -The Tangle will respond with the latest statistics: +For a quick check, type `python3` at the command line to open an interactive session then tell SenseHat to scroll a "Hello Sense Hat" message across the LED screen. Follow these commands: ``` -{'appName': 'IRI Testnet', - 'appVersion': '1.8.0-RC1', - 'coordinatorAddress': 'EQQFCZBIHRHWPXKMTOLMYUYPCN9XLMJPYZVFJSAY9FQHCCLWTOLLUGKKMXYFDBOOYFBLBI9WUEILGECYM', - 'duration': 0, - 'features': ['dnsRefresher', 'testnet', 'zeroMessageQueue', 'RemotePOW'], - 'jreAvailableProcessors': 8, - 'jreFreeMemory': 14557498488, - 'jreMaxMemory': 22906667008, - 'jreTotalMemory': 16883646464, - 'jreVersion': '1.8.0_181', - 'lastSnapshottedMilestoneIndex': 434525, - 'latestMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestMilestoneIndex': 1313715, - 'latestSolidSubtangleMilestone': TransactionHash(b'VGIOPUTTHVRKZMSPYLV9RLFGUCXMSZPKXKMQWLJCAZKWGACXUSXMJHCNLHWBVZGLSRTYDUEOAWTTBS999'), - 'latestSolidSubtangleMilestoneIndex': 1313715, - 'milestoneStartIndex': 434527, - 'neighbors': 3, - 'packetsQueueSize': 0, - 'time': 1565638086467, - 'tips': 733, - 'transactionsToRequest': 0} +$ python3 +>>>from sense_hat import SenseHat +>>>sense = SenseHat() +>>>sense.show_message("Hello Sense Hat") ``` -[Running in headless mode](Headless.md) +The message, "Hello Sense Hat", will scroll across the Sense Hat LED screen. Take a look in the AstroPiQuake emulator + +To learn more, try all the features of your SenseHat by completing this tutorial: [Raspberry Pi getting started with Sense Hat](https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat) + +## Optional: running AstroPiQuake in headless mode + +[Running AstroPiQuake in headless mode](Headless.md) diff --git a/folder/zh/README.md b/folder/zh/README.md index a8776fd..c50f194 100644 --- a/folder/zh/README.md +++ b/folder/zh/README.md @@ -1,22 +1,14 @@ -## AstroPiOTA +## AstroPiQuake -You can sense environment data using SenseHat and Raspberry Pi You can store the data on the Tangle or sell it on data marketplaces such as [I3 Marketplace](http://ec2-18-217-227-236.us-east-2.compute.amazonaws.com:8000/). +AstroPiQuake gathers environment data using SenseHat and Raspberry Pi -AstroPiOTA is a clone of AstroPi that connects to the IOTA Tangle. That's why it's called AstroPiOTA! The Tangle is a distributed ledger useful for storing and sharing data. +[AstroPi](https://www.nasa.gov/mission_pages/station/research/experiments/explorer/Investigation.html?#id=7534) flies onboard the International Space Station (ISS) keeping astronauts update-to-date about their environment. Here on Earth, you can monitor your local environment data and detect earthquakes using a clone of AstroPi called "AstroPiQuake" -[AstroPi](https://www.nasa.gov/mission_pages/station/research/experiments/2429.html) flies onboard the International Space Station (ISS) keeping astronauts update-to-date about their environment. Here on Earth, you can monitor your local environment data and store it on the Tangle. - -Try out the [AstroPiOTA emulator](http://www.nelsontech.blog/I3/Phase1/AstroPiOTAemulator-Smiley.htm). Move the temperature slider to see Smiley's face change colors from cool blue to mellow yellow to red hot. Take a look at [earthquake detection](http://www.nelsontech.blog/I3/Phase1/AstroPiOTAemulator-Earthquake.htm). Grab AstroPiOTA with your mouse and move it. Watch the graph change as it detects you simulating an earthquake. +Try out the [AstroPiQuake emulator](https://trinket.io/python/9c2e984979). Move the temperature slider to see Smiley's face change colors from cool blue to mellow yellow to red hot. Take a look at [earthquake detection](https://trinket.io/python/86417fad20). Grab AstroPiQuake with your mouse and shake it. Watch the graph change as it detects you simulating an earthquake. ### Sensing environment data -Sense Hat has an IMU or Inertial Measurement Unit with these [specifications](SenseHatSpecs.md): - -- Temperature and humidity sensors -- Barometric Pressure sensor -- Accelerometer that measures acceleration forces -- Gyroscope that measures momentum and rotation -- Magnetometer that measures the Earth’s own magnetic field, a bit like a compass +Sense Hat has temperature and humidity sensors. It can sense the barometric pressure. It has an IMU or Inertial Measurement Unit with an accelerometer that measures acceleration forces, a gyroscope that measures momentum and rotation, and a magnetometer that measures the Earth’s own magnetic field, similar to a compass. Here are the [technical specifications](SenseHatSpecs.md). Accelerometer and gyroscope data are measured using [coordinates](https://en.wikipedia.org/wiki/Euler_angles). These are sometimes referred to as yaw, pitch, and roll. @@ -25,42 +17,27 @@ Accelerometer and gyroscope data are measured using [coordinates](https://en.wik z is roll or rotation about the z-axis -## Building your own AstroPiOTA - -[Building the environment sensor](BuildIT.md) - -[Installing software and configuring your device](InstallIT.md) - -[Running in headless mode](Headless.md) +## Building your own AstroPiQuake -## Using your data +[Building your own AstroPiQuake environment sensor](BuildIT.md) -You can store your data directly to the Tangle +[Configuring AstroPiQuake and installing software](InstallIT.md) -[Storing data directly to the Tangle](direct2Tangle.md) +[Optional: running AstroPiQuake in headless mode](Headless.md) -[Viewing data using the Devnet Tangle Explorer](https://devnet.thetangle.org/) +## Gathering data -[Retrieving data using ZMQ](https://github.com/NelsonPython/IoT-ZMQ-listener/blob/master/README.md) +Watching sensor readings - -## Selling your data -You sell data by publishing it on the I3 Marketplace where subscribers can buy it: - -[Publishing data to I3 Data Marketplace](I3-publish.md) - -[Retrieving your data subscription](I3-subscribe.md) +Saving sensor data in a MySQL table ## Investigating your data -[Getting starting with the AstroPiOTA notebook on Kaggle](https://www.kaggle.com/nelsondata/astropiota-weather-los-angeles) - -[Charting your data on ThingSpeak](https://thingspeak.com/channels/865101) +[Charting your AstroPiQuake data on ThingSpeak](https://thingspeak.com/channels/865101) -## Learning as we go +## Experimenting -- Seeds are only needed for sending value transactions +[Broadcasting messages onboard an AV](https://github.com/NelsonPython/DriveI5) -- As of October 2019, Raspberry Pi Buster operating system appears to have a WiFi Bug. You may want to use Stretch until a solution is found. Learn more: https://www.raspberrypi.org/forums/viewtopic.php?t=252984 +[Detecting earthquakes](https://www.kaggle.com/nelsondata/confirming-earthquake-detection) -- This tutorial has not been tested with Python 3.7 diff --git a/folder/zh/viewAstroPiQuake.md b/folder/zh/viewAstroPiQuake.md new file mode 100644 index 0000000..647fa50 --- /dev/null +++ b/folder/zh/viewAstroPiQuake.md @@ -0,0 +1,43 @@ +

Viewing AstroPiQuake sensor data

+ +AstroPiQuake senses temperature, humidity, and pressure. It gets gyroscope and accelerometer readings. + +This getData.py script senses data and prints it in json format + +``` +#!/usr/bin/python + +import datetime +from sense_hat import SenseHat + +sense = SenseHat() + +sensors = {} +sensors["pressure"] = str(sense.get_pressure()) +sensors["temperature"] = str(sense.get_temperature()) +sensors["humidity"] = str(sense.get_humidity()) + +o = sense.get_orientation() +sensors["pitch"] = str(o["pitch"]) +sensors["roll"] = str(o["roll"]) +sensors["yaw"] = str(o["yaw"]) + +a = sense.get_accelerometer_raw() +sensors["x"] = str(a["x"]) +sensors["y"] = str(a["y"]) +sensors["z"] = str(a["z"]) + +t = datetime.datetime.now() +sensors["timestamp"] = str(t.strftime('%Y%m%d %H:%M')) +sensors["lng"] = '-118.323411' +sensors["lat"] = '33.893916' +sensors["device_name"] = "AstroPiQuake" + +print(sensors) +``` + +

json

+ +``` +{'pressure': '0', 'lat': '33.893916', 'z': '-0.02169257216155529', 'pitch': '2.6417886780271713', 'roll': '281.7232590548508', 'yaw': '134.7106325472459', 'lng': '-118.323411', 'y': '-0.972381591796875', 'humidity': '39.247840881347656', 'device_name': 'AstroPiQuake', 'x': '-0.0034556991886347532', 'timestamp': '20200528 12:31', 'temperature': '31.669998168945312'} +```