Update docs

This commit is contained in:
Anthony Rabine 2023-05-02 18:17:03 +02:00
parent 67ded5aace
commit 47b3060de5
16 changed files with 381 additions and 386 deletions

View file

@ -4,7 +4,7 @@ Open Story Teller is an Open Source project to provide guidelines and software t
The main goal is to *not* make electronics boards but instead buy or reuse existing ones. This will allow you to easily repair your device with spare parts. The main goal is to *not* make electronics boards but instead buy or reuse existing ones. This will allow you to easily repair your device with spare parts.
We propose a set of parts and firmware that is working well togather but your are free to custom everything to fit your needs. We propose a set of parts and firmware that is working well together but your are free to custom everything to fit your needs.
This project can be used as a base platform for any device that is composed by: This project can be used as a base platform for any device that is composed by:
- A display (TFT...) - A display (TFT...)
@ -14,15 +14,33 @@ This project can be used as a base platform for any device that is composed by:
# Links # Links
- http://openstoryteller.org/: main documentation and project news - http://openstoryteller.org/: main documentation, project news, guidelines, hardware shoping list...
- http://github.com/arabine/open-story-teller: source code, tickets, help - http://github.com/arabine/open-story-teller: source code, tickets, help
# Hardware parts
We propose the concept of bundles: a set of electronic boards that you can purchase quite easily (eg: Arduino, SeedStudio, Pimoroni, Adafruit, SparkFun...). The bundles are built around a central main board, the CPU, which comes with more or less peripherals (SD-Card reader, Wifi...).
Several bundles will be officially supported ; this is needed for us to ensure the portability of the firmware hardware interface layer.
Current bundles:
- Raspberry Pico (official DevKit) (ARM Cortex M0+)
- RISC-V based board (GD32VF103)
We plan to propose a mechanical enclosure ready to be printed for an official bundle.
See the documentation!
# Generic player software # Generic player software
The base software is highly portable and includes a micro virtual machine. This allow potential complex stories with loops, branches, user choices, randomization... The base software is highly portable and includes a micro virtual machine. This allow potential complex stories with loops, branches, user choices, randomization...
This project propose an minimal cross-platform GUI player application that can be used as a base project. This project propose an minimal cross-platform GUI player application that can be used as a base project.
Current status:
- Project broken, needs rework to embed the micro-VM
- Qt/QML based, easily portable
# StoryTeller Editor # StoryTeller Editor
We propose a basic editor tool to create your own stories. The generated story script runs on our micro virtual machine and allow generate complex stories. We propose a basic editor tool to create your own stories. The generated story script runs on our micro virtual machine and allow generate complex stories.

View file

@ -8,7 +8,7 @@ export default defineConfig({
// https://vitepress.dev/reference/default-theme-config // https://vitepress.dev/reference/default-theme-config
nav: [ nav: [
{ text: 'Home', link: '/' }, { text: 'Home', link: '/' },
{ text: 'Examples', link: '/markdown-examples' } { text: 'Documentation', link: '/intro-getting-started' }
], ],
search: { search: {
@ -17,10 +17,41 @@ export default defineConfig({
sidebar: [ sidebar: [
{ {
text: 'Examples', text: 'Introduction',
collapsed: false,
items: [ items: [
{ text: 'Markdown Examples', link: '/markdown-examples' }, { text: 'Getting started', link: '/intro-getting-started' }
{ text: 'Runtime API Examples', link: '/api-examples' } ]
},
{
text: 'Bundles assembly guides',
collapsed: false,
items: [
{ text: 'Bundles introduction', link: '/guide-intro' },
{ text: 'Dev kit (Raspberry Pico)', link: '/guide-devkit-pico' },
{ text: 'SeeedStudio Wio Lite', link: '/guide-wio-lite' },
{ text: 'Arduino MKR Zero', link: '/guide-mkr-zero' }
]
},
{
text: 'Software player',
collapsed: false,
items: [
{ text: 'Player information', link: '/player-intro' }
]
},
{
text: 'Story editor',
collapsed: false,
items: [
{ text: 'User manual', link: '/editor-intro' },
]
},
{
text: 'Developers corner',
collapsed: false,
items: [
{ text: 'Source code architecture', link: '/dev-intro' },
] ]
} }
], ],

View file

@ -1,49 +0,0 @@
---
outline: deep
---
# Runtime API Examples
This page demonstrates usage of some of the runtime APIs provided by VitePress.
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
```md
<script setup>
import { useData } from 'vitepress'
const { theme, page, frontmatter } = useData()
</script>
## Results
### Theme Data
<pre>{{ theme }}</pre>
### Page Data
<pre>{{ page }}</pre>
### Page Frontmatter
<pre>{{ frontmatter }}</pre>
```
<script setup>
import { useData } from 'vitepress'
const { site, theme, page, frontmatter } = useData()
</script>
## Results
### Theme Data
<pre>{{ theme }}</pre>
### Page Data
<pre>{{ page }}</pre>
### Page Frontmatter
<pre>{{ frontmatter }}</pre>
## More
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).

49
docs/dev-intro.md Normal file
View file

@ -0,0 +1,49 @@
# Software development
## Firmware/software
The firmware is highly configurable and highly portable. To achieve that, it is split in multiple parts:
- The core source file, which is common to every target
- the ports, dedicated to an embedded MCU and board
- The tests, to easily test part of source on a standard PC
- A desktop/mobile implementation
The core is written in pure C, targets implementations may add other languages and libraries (QML/C++/python ...).
## CMake build system
The project uses CMake as build system. For the embedded targets, the main CMakeLists.txt includes a generic cross compiler file that should be good for many configurations as soon as your compiler is GCC.
## Invocation
1. Create a build directory (mkdir build)
2. Invoke cmake with some options, passed as definitions for CMake (-Doption)
| Option | Role |
| -------------------- | --------------------------------------------------------- |
| TOOLCHAIN | specify the prefix name of the cross GCC binary |
| CMAKE_TOOLCHAIN_FILE | Includes before everything else a compiler toolchain file |
| CMAKE_BUILD_TYPE | Debug or Release (default ?) |
| OST_BUNDLE | Specify the bundle name to build |
| TOOLCHAIN_DIR | Specify a directory for the cross-gcc toolchain location |
Example: `cmake -DTOOLCHAIN=riscv64-unknown-elf -DCMAKE_TOOLCHAIN_FILE=cmake/cross-gcc.cmake -DCMAKE_BUILD_TYPE=Debug -DOST_BUNDLE=LONGAN_NANO ..`

5
docs/editor-intro.md Normal file
View file

@ -0,0 +1,5 @@
---
outline: deep
---
# Story editor

72
docs/guide-devkit-pico.md Normal file
View file

@ -0,0 +1,72 @@
# Development kit: Raspberry Pico
This is the official development kit. It offers the following advantages:
1. Low cost
2. Parts are easy to find
3. Low wiring/soldering: usage of a motherboard
4. SWD debug port
Current status: ON DEVELOPMENT
![pico](./images/devkit-pico.jpg)
## Bill of materials
The minimal list of components are:
| Part | Price | Shop |
| ----------------------------------------- | -------- | --------- |
| Audio board + speaker | 13 € | Waveshare |
| Raspberry Pico W | 9 € | Kubii |
| 2inch LCD (320x240) | 14 € | Waveshare |
| Some Pimoroni buttons are rotary switches | 4 € | Pimoroni |
| UPS module or Pimoroni LiPo Shim | 15 € | Waveshare |
| LiPo battery 500mAh | 9 € | Any |
| Carte d'extension GPIO Pico Decker | 15 € | Waveshare |
| **TOTAL** | **67 €** |
In addition to this list, you may need some more materials such as wires, prototype boards, resistors...
We may propose in the future a PCB to help the connection without soldering.
![pico](./images/prototype-board.png)
# Developers: how to build from the source code
## Install build tools
Install build tools, example for a Debian based operating system:
- sudo apt install gcc-arm-none-eabi
- sudo apt install picolibc-arm-none-eabi
Download the pico SDK somewhere on your disk:
```
git clone https://github.com/raspberrypi/pico-sdk
```
Copy past the following command line, execute at the directory root. Replace the PICO_SDK_PATH value with the real location on your disk where you have installed the Pico SDK.
First, create a CMake build directory:
```
mkdir build
cd build
```
Then generate the makefile (we use the Pico toolchain here, so there is no specific toolchain file to setup.)
```
cmake -DCMAKE_BUILD_TYPE=Debug -DOST_BUNDLE=RASPI_PICO -DPICO_SDK_PATH=../pico-sdk -DPICO_BOARD=pico_w ..
```
This assume that the Pico SDK is located on the git project root directory. Change this path according to your real Pico SDK location.

21
docs/guide-intro.md Normal file
View file

@ -0,0 +1,21 @@
---
outline: deep
---
# Hardware bundles
A bundle is a collection of electronics boards that are supported by official firmware builds. They are tested and a pre-build binary is availbale to direct download.
Keep in mind that the official bundles proposed are not "cost-optimized" or sometimes difficult to buy. There are many rooms of improvements.
The goal of official bundles is to test the firmware on very different kind of hardware to make sure that the core firmware is highly portable.
The price indicated is purely informative.
## Hardware architecture overview
Basically, it is a portable sound device that plays sound files and sometimes displays an image. Here is the diagram :
![proto](./images/architecture.png)

21
docs/guide-mkr-zero.md Normal file
View file

@ -0,0 +1,21 @@
## Arduino MKR Zero (SAMD21G18A)
| Category | Maker | Name | Rounded Price |
| ------------------ | ------------------------------ | --------------------- | ------------- |
| Main CPU board | Arduino | MKR Zero | 30€ |
| Audio | | | 15€ |
| Memory storage | Included SD card slot on board | | - |
| Battery management | Included LiPo charger on board | | - |
| Display | NewHaven 2.4" TFT | NHD-2.4-240320CF-BSXV | 22€ |
### How to build
Install on Ubuntu :
- sudo apt install gcc-arm-none-eabi
- sudo apt install picolibc-arm-none-eabi
cmake -DTOOLCHAIN=arm-none-eabi -DCMAKE_TOOLCHAIN_FILE=cmake/cross-gcc.cmake -DCMAKE_BUILD_TYPE=Debug -DOST_BUNDLE=MKR_ZERO ..
### Wiring
TBD

72
docs/guide-wio-lite.md Normal file
View file

@ -0,0 +1,72 @@
## Sipeed Longan Nano (GD32VF103CBT6) - TO BE REPLACED WITH WIO LITE
Current status: ON DEVELOPMENT
## What does it look like
The firmware is still under construction. Everything is tested on breadboard.
![proto](images/ost-1/complete.png)
What is working:
- The audio path
- The SD Card
- Roughly: playing a wav file from the SD Card
## Audio path
An I2S DAC controller with a jack output :
![proto](images/ost-1/audio_board.webp)
An audio amplifier from Adafruit (2.5W, can drive a speaker between 3 ohms and 8 ohms).
![proto](images/ost-1/audio_amplifier.png)
A speaker :
![proto](images/ost-1/speaker_4ohms_3w.png)
| Category | Maker | Name | Rounded Price |
| ------------------ | ------------------------------------ | ----------- | ------------- |
| Main CPU board | Sipeed | Longan Nano | 4€ |
| Audio | | | 15€ |
| Memory storage | Included SD card slot in Longan Nano | | - |
| Battery management | | | 15€ |
| Part | Price | Shop |
| ------------------------------------------------- | -------- | ---------- |
| PCM5102 Audio board | 4 € | Aliexpress |
| PAM8302 Mono Amplifier | 9 € | Adafruit |
| Longan Nano RISC-V board with SD-Card port | 4 € | Aliexpress |
| 3.2" SPI TFT Screen (320x240) with ILI9341 driver | 9 € | Aliexpress |
| Adafruit PowerBoost 500 charger | 15 € | Adafruit |
| Some Pimoroni buttons are rotary switches | 4 € | Pimoroni |
| Speaker | 4 € | Pimoroni |
| LiPo battery 500mAh | 9 € | Any |
| **TOTAL** | **58 €** |
### How to build
Tools for a Debian based distro
- sudo apt install crossbuild-essential-riscv64
- sudo apt install picolibc-riscv64-unknown-elf
mkdir build
cd build
cmake -DTOOLCHAIN=riscv64-unknown-elf -DCMAKE_TOOLCHAIN_FILE=cmake/cross-gcc.cmake -DCMAKE_BUILD_TYPE=Debug -DOST_BUNDLE=LONGAN_NANO ..
Convert tools:
- riscv64-unknown-elf-objcopy -O binary your-file.elf your-file.hex
- riscv64-unknown-elf-objcopy -O ihex your-file.elf your-file.hex
### Wiring
TBD

View file

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 76 KiB

BIN
docs/images/devkit-pico.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

View file

@ -4,256 +4,24 @@ layout: home
hero: hero:
name: "Open Story Teller" name: "Open Story Teller"
text: "Make your own device that tells stories" text: "Hardware and software that tell stories"
tagline: My great project tagline tagline: Make your own, its free sofware
actions: actions:
- theme: brand - theme: brand
text: Markdown Examples text: Getting started
link: /markdown-examples link: /intro-getting-started
- theme: alt - theme: alt
text: API Examples text: Assembly guidelines
link: /api-examples link: /guide-intro
features: features:
- title: Feature A - title: Easy to repair
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit details: Complete information is available to change parts and explain how it works
- title: Feature B - title: Easy to custom
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit details: Hardware abstraction layer to help you porting to any hardware
- title: Feature C - title: Listen everywhere
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit details: Keep your stories for life, listen to any device (custom, desktop, mobile, command line...)
- title: Create complex stories
details: The story editor uses a node graph engine with programming nodes
--- ---
# Firmware/software
The firmware is highly configurable and highly portable. To achieve that, it is split in multiple parts:
- The core source file, which is common to every target
- the ports, dedicated to an embedded MCU and board
- The tests, to easily test part of source on a standard PC
- A desktop/mobile implementation
The core is written in pure C, targets implementations may add other languages and libraries (QML/C++/python ...).
## GCC build system
The project uses CMake as build system. For the embedded targets, the main CMakeLists.txt includes a generic cross compiler file that should be good for many configurations as soon as your compiler is GCC.
## Invocation
1. Create a build directory (mkdir build)
2. Invoke cmake with some options, passed as definitions for CMake (-D<option>)
| Option | Role |
| -------------------- | --------------------------------------------------------- |
| TOOLCHAIN | specify the prefix name of the cross GCC binary |
| CMAKE_TOOLCHAIN_FILE | Includes before everything else a compiler toolchain file |
| CMAKE_BUILD_TYPE | Debug or Release (default ?) |
| OST_BUNDLE | Specify the bundle name to build |
| TOOLCHAIN_DIR | Specify a directory for the cross-gcc toolchain location |
Example: `cmake -DTOOLCHAIN=riscv64-unknown-elf -DCMAKE_TOOLCHAIN_FILE=cmake/cross-gcc.cmake -DCMAKE_BUILD_TYPE=Debug -DOST_BUNDLE=LONGAN_NANO ..`
# Hardware bundles
Here is a list of currently supported bundles. A bundle is a collection of electronics boards that are supported by official firmware builds.
Keep in mind that the official bundles proposed are not "cost-optimized". There are many rooms of improvements. The best bundles are marked with three stars "***": parts are easy to buy and the cost is minimal.
The goal of official bundles is to test the firmware on very different kind of hardware to make sure that the core firmware is highly portable.
The price indicated is purely informative.
## Raspberry Pico (Official DevKit!)
| Category | Brand | Reference | Aproximate Price |
| ------------------ | ------------------------------ | --------------------- | ---------------- |
| Main CPU board | Rasperry Pico | MKR Zero | 30€ |
| Audio | | | 15€ |
| Memory storage | SD card slot on board | | - |
| Battery management | Included LiPo charger on board | | - |
| Display | NewHaven 2.4" TFT | NHD-2.4-240320CF-BSXV | 22€ |
### Install build tools
Install build tools, example for a Debian based operating system:
- sudo apt install gcc-arm-none-eabi
- sudo apt install picolibc-arm-none-eabi
Download the pico SDK somewhere on your disk:
```
git clone https://github.com/raspberrypi/pico-sdk
```
### How to build
Copy past the following command line, execute at the directory root. Replace the PICO_SDK_PATH value with the real location on your disk where you have installed the Pico SDK.
First, create a CMake build directory:
```
mkdir build
cd build
```
Then generate the makefile (we use the Pico toolchain here, so there is no specific toolchain file to setup.)
```
cmake -DCMAKE_BUILD_TYPE=Debug -DOST_BUNDLE=RASPI_PICO -DPICO_SDK_PATH=../pico-sdk -DPICO_BOARD=pico_w ..
```
This assume that the Pico SDK is located on the git project root directory. Change this path according to your real Pico SDK location.
## Sipeed Longan Nano (GD32VF103CBT6)
| Category | Maker | Name | Rounded Price |
| ------------------ | ------------------------------------ | ----------- | ------------- |
| Main CPU board | Sipeed | Longan Nano | 4€ |
| Audio | | | 15€ |
| Memory storage | Included SD card slot in Longan Nano | | - |
| Battery management | | | 15€ |
### How to build
Tools for a Debian based distro
- sudo apt install crossbuild-essential-riscv64
- sudo apt install picolibc-riscv64-unknown-elf
mkdir build
cd build
cmake -DTOOLCHAIN=riscv64-unknown-elf -DCMAKE_TOOLCHAIN_FILE=cmake/cross-gcc.cmake -DCMAKE_BUILD_TYPE=Debug -DOST_BUNDLE=LONGAN_NANO ..
Convert tools:
- riscv64-unknown-elf-objcopy -O binary your-file.elf your-file.hex
- riscv64-unknown-elf-objcopy -O ihex your-file.elf your-file.hex
### Wiring
TBD
## Arduino MKR Zero (SAMD21G18A)
| Category | Maker | Name | Rounded Price |
| ------------------ | ------------------------------ | --------------------- | ------------- |
| Main CPU board | Arduino | MKR Zero | 30€ |
| Audio | | | 15€ |
| Memory storage | Included SD card slot on board | | - |
| Battery management | Included LiPo charger on board | | - |
| Display | NewHaven 2.4" TFT | NHD-2.4-240320CF-BSXV | 22€ |
### How to build
Install on Ubuntu :
- sudo apt install gcc-arm-none-eabi
- sudo apt install picolibc-arm-none-eabi
cmake -DTOOLCHAIN=arm-none-eabi -DCMAKE_TOOLCHAIN_FILE=cmake/cross-gcc.cmake -DCMAKE_BUILD_TYPE=Debug -DOST_BUNDLE=MKR_ZERO ..
### Wiring
TBD
# Mechanical and enclosure
Use existing enclosures, build your own using wood or 3D printing... we do not propose (yet) any standard package, sorry :(
# Future targets
- ESP32 (low cost and high availability)
- RP2040
# How to build a custom Open Story Teller box
## What is a Story Teller box?
It is a little electronics device that tells stories, mainly for children. A tiny LCD screen is used only to perform choices and create some variants of the stories.
## Architecture overview
Basically, it is a portable sound device that plays mp3 and sometimes displays an image. Here is the diagram :
![proto](images/architecture.png)
## Goal
The goal of this project is to help you build your own Open Story Teller box with **existing boards**. I do not plan to build any custom board. This is because :
1. You can re-use old boards
2. You avoid wastes
3. It is relatively cheap (only if you reuse spare parts)
4. It is repairable
## Bill of materials
- A microcontroller unit board
- A rechargable battery board
- A LCD screen (320x240)
- An audio board
- Rotary switches, push buttons
- A Speaker
- A SD-Card connector
- Enclosure (wood, 3D printer-based...)
- Finally, a suitable firmware
Depending of your hardware choice, the provided firmware should be updated. The goal of this projet is to support a **selection of boards**.
# Prototype, code-name OST-1
## Presentation
For this first step, we will deliver a working prototype so that we will have a firmware to work on. This step will give us a lot of knownledge for the next step. For now, there is no price optimization.
Technology choices are :
| Part | Price | Shop |
| ------------------------------------------------- | -------- | ---------- |
| PCM5102 Audio board | 4 € | Aliexpress |
| PAM8302 Mono Amplifier | 9 € | Adafruit |
| Longan Nano RISC-V board with SD-Card port | 4 € | Aliexpress |
| 3.2" SPI TFT Screen (320x240) with ILI9341 driver | 9 € | Aliexpress |
| Adafruit PowerBoost 500 charger | 15 € | Adafruit |
| Some Pimoroni buttons are rotary switches | 4 € | Pimoroni |
| Speaker | 4 € | Pimoroni |
| LiPo battery 500mAh | 9 € | Any |
| **TOTAL** | **58 €** |
/!\ Achtung /!\ We can easily lower some prices, especially if your MCU controller already contains a battery connector. Remember, this first step is to test various parts.
## What does it look like
The firmware is still under construction. Everything is tested on breadboard.
![proto](images/ost-1/complete.png)
What is working:
- The audio path
- The SD Card
- Roughly: playing a wav file from the SD Card
## Audio path
An I2S DAC controller with a jack output :
![proto](images/ost-1/audio_board.webp)
An audio amplifier from Adafruit (2.5W, can drive a speaker between 3 ohms and 8 ohms).
![proto](images/ost-1/audio_amplifier.png)
A speaker :
![proto](images/ost-1/speaker_4ohms_3w.png)

View file

@ -0,0 +1,65 @@
# Getting started
This documentation will guide you to make your own story teller. You can choose between a purely software version (for desktop or mobile), or a hardware version with electronics boards, wires and mechanical enclosure.
## Where to start
Before building your own hardware, make sure you have a minimal knowledge of basic electronics. You may have to solder some wires, but nothing's complicated.
The general procedure is:
1. Choose your hardware bundle and buy parts
2. Follow the guidelines to assemble your device
3. Flash the last firmware binary available for your bundle
4. Use the StoryEditor to create your first story
5. Copy the story pack onto the SD-Card memory
6. Enjoy
## How much does it cost?
Without the enclosure, you can expect something between 30 € and 50 € depending on your hardware choices. Try to reuse a maximum of spare parts to lower the price (resistors, buttons...).
## What tools do I need?
It is not exhaustive but here is a minimal list:
- Soldering station
- Solder
- Resistors
- USB cables
- Jumper cables
- Headers
- Prototype boards
## What about the software player?
The software player is free and open source, you can rebuild it from the source code or download prebuild releases. See dedicated section.
## Informations
The Github project is https://github.com/arabine/open-story-teller. Feel free to use it for any project related topics:
- Report bugs
- Download the lastest firmware builds
- Download the software player
- Download the StoryEditor
- Propose patches
# Mechanical enclosure
Not yet, waiting for the availability of the first complete kit to determine the form factor.
# Planned ideas
- ESP32 target (low cost and high availability)
- Add a microphone
- Mobile version with text-to-speach and voice recognition
- Propose to buy a PCB for I/O connections (buttons, rotary, LED...)
# License
MIT License
Copyright (c) 2023 Anthony Rabine

View file

@ -1,85 +0,0 @@
# Markdown Extension Examples
This page demonstrates some of the built-in markdown extensions provided by VitePress.
## Syntax Highlighting
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
**Input**
````
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
````
**Output**
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
## Custom Containers
**Input**
```md
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
```
**Output**
::: info
This is an info box.
:::
::: tip
This is a tip.
:::
::: warning
This is a warning.
:::
::: danger
This is a dangerous warning.
:::
::: details
This is a details block.
:::
## More
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).

7
docs/player-intro.md Normal file
View file

@ -0,0 +1,7 @@
---
outline: deep
---
# Software player