Commit 1f3bd549 authored by Frank Lars Zimdars's avatar Frank Lars Zimdars Committed by Bernd-Christian Renner
Browse files

corrections

parent aa51d7b7
......@@ -19,20 +19,22 @@ Git repositories (old):
Toolchain:
* [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads)
* [GNU Arm Embedded Toolchain](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads)
* [https://cmake.org/download/](https://cmake.org/download/)
* [CMake](https://cmake.org/download/)
Misc:
* [stm32flash](https://sourceforge.net/p/stm32flash/wiki/Home)
* [https://docs.microsoft.com/en-gb/windows/wsl/install-win10](https://docs.microsoft.com/en-gb/windows/wsl/install-win10)
* [STM32 ST-LINK utility](https://www.st.com/en/development-tools/stsw-link004.html)
Misc:
* [Windows Subsystem for Linux Installation Guide for Windows 10](https://docs.microsoft.com/en-gb/windows/wsl/install-win10)
https://sourceforge.net/p/stm32flash/wiki/Home
Documentation:
*[https://www.st.com/en/development-tools/stsw-link004.html](https://www.st.com/en/development-tools/stsw-link004.html)
* [MKDocs](https://www.mkdocs.org/)
......@@ -13,7 +13,7 @@ The PyLib has to be installed on every device on which the programm should run.
## API
To use the Modem API you have to import the Modem Class:
To use the Modem API you have to import the Modem Class into your python script:
``` python
from ahoi.modem.modem import Modem
......@@ -21,18 +21,20 @@ from ahoi.modem.modem import Modem
### Modem class
Create a variable of the type Modem:
``` python
modem = Modem()
```
#### Connect
Direct connection via serial port:
Connect to a modem via serial port:
``` python
modem.connect("COM1")
```
Connect to a (sfwd) server which provides acces to a modem:
Alternative connect to a (sfwd) server which provides acces to a modem:
``` python
modem.connect("TCP@SERVERADDR")
```
......@@ -69,12 +71,11 @@ For the reception of packets, two ways are possible: blocking and non-blocking.
For the non-blocking behaviour a new thread is created at the function call. The thread waits on the packet
and calls the registered callback function if a packet was received.
- Tread mode: Non blocking, Using callback function when package received.
- Non Thread mode: blocking, waiting until reception
In the blocking mode the reception function only returns after the reception is finished/aborted.
##### Non-blocking mode
###### Callback
###### Callback functions
The callback function has to have the following footpring:
......@@ -108,8 +109,10 @@ def removeRxHandler(self, h, type=None):
modem.receive(thread = True)
```
Set "thread" to true if you want the non-blocking behaviour and the functions returns after the thread for reception is created.
Otherwise the function will return after the corresponding reception handler is finished.
##### Non Thread mode
#### Localisation / Ranging
......@@ -132,9 +135,8 @@ print("distance: %6.1f" % (tof))
The value for the speed of sound depends on the medium and temperature. Look up the value in a table, or measure the value on your own.
A delay before the ack is send back can be configurable with the following command (delay in ms). If multiple modems are used, each modem should have a different delay.
Otherwise the the ack can be disturbed, when
multiple send their signals at the same time.
A delay before the ack is send back can be configured with the following command (delay in ms). If multiple modems are used, each modem should have a different delay time.
Otherwise the the ack can be disturbed, when multiple modems try to send their signals at the same time.
```
rangeDelay(self, delay=None)
......@@ -142,7 +144,7 @@ rangeDelay(self, delay=None)
```
**Note:** The modem has an tnternal delay of 34us. At the moment this is not substracted from the tof.
**Note:** The modem has an internal delay of 34us. At the moment this is not automaticly substracted from the TOF.
#### Updating firmware
......@@ -154,7 +156,7 @@ rangeDelay(self, delay=None)
The flashing of the firmware is done through the external "stm32flash" programm, which has to be installed to sucessful execute this command.
Take a look in the [Update the firmware tutorial](/tutorial_update).
Start the update with the following command. The parameter *empty* has to be *true* if the modem doesn't already contain already a firmware.
Start the update with the following command. The parameter *empty* has to be set to *true* if the modem doesn't contain a firmware.
```
program(self, img='ahoi.hex', empty=False)
......
# Create the documentation
# Install tools
```
pip3 install mkdocs
pip3 install mkdocs-material
pip3 install mkdocs-git-revision-date-plugin
```
# Generate preview
```
python3 -m mkdocs serve
```
# Generate offline documentation
```
python3 -m mkdocs build
```
# Used tools
- draw.io
......@@ -110,16 +110,3 @@ Part of the pylib.
The
```
oo
`#!00`
```
function is used to generate a sequence of numbers.
<p style="background-color:lightgrey">
00 <span style="color:#FF0000">01</span> 02
</p>
......@@ -17,7 +17,7 @@ to flash a firmware.
## AHOI firmware
A compiled ahoi firmware binary ahoi.hex is required. If you don't have one, take a look at "setup/firmware" to compile your own.
A compiled ahoi firmware binary ahoi.hex is required. If you don't have one, take a look at ["setup/firmware"](/setup_fw) to compile your own.
## Install tools
......@@ -58,9 +58,9 @@ $ python3 mosh .py
```
!!! info "info"
An alternative way to set the microcontroller into bootloader mode is to press the button on the mainboard. The button have to be hold down at power-on.
An alternative way to set the microcontroller into bootloader mode is to press and hold the button on the mainboard during power-on.
This is even possible if no firmware is loaded or not working.
This is even possible if no firmware is loaded or working.
In the previous example, current fimware version is master-1591-3949610, which means:
Parameter Value
......@@ -69,9 +69,7 @@ Git commit count 1591
Git commit id 3949610
Afterwards, navigate to the folder, which contains the compiled firmware binary ahoi.hex
(cf. Section 2.1) and
flash the ahoi modem with stm32
flash (cf. Section 2.3):
and flash the ahoi modem with stm32flash:
```
......
......@@ -47,6 +47,7 @@ markdown_extensions:
- pymdownx.inlinehilite
plugins:
- search
- search:
lang: en
- git-revision-date
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment