30 questions
1
vote
1
answer
433
views
How can I perform a set of crud REST api with tinygo?
I'm currently working on a personal project. Notably to discover the possibilities of Web Assembly and Tinygo.
I have a small project which use vanilla.js and a simple index.html containing a button. ...
2
votes
0
answers
447
views
Setting BLE Advertising Address using Tiny-Go Bluetooth
I'm using Tiny-Go's bluetooth to generate Bluetooth Low Energy (BLE) messages on a Raspberry Pi 4 (Raspbian, Linux 6.1.21, Bluez 5.55) like this:
adv := constants.Adapter.DefaultAdvertisement()
...
4
votes
1
answer
632
views
Golang to wasm compilation using tinygo. Execution using wasmtime
I have the following test code
func main() {
path, err := os.Getwd()
log.Println(path, err)
files, err := ioutil.ReadDir("/etc/dse")
log.Println(files, err)
}
I compile it to ...
1
vote
0
answers
288
views
Golang Bluetooth adapter.Scan stops by itself
I am using the tinygo-org/bluetooth package. When I run the scanner in the example, after a while the panic drops. I can't find the cause, does anyone have any idea what it could be? Thanks.
0
votes
1
answer
121
views
How to get buttons working on Badger2040 in Tinygo
I've been trying to access the Badger2040 buttons through Tinygo and not having any luck (I have succeeded in CircuitPython before).
When I try to change the led state based on Button A, the led is ...
0
votes
2
answers
1k
views
WebAssembly / Go (tinygo) function execution time extremely slow
I compiled a go code with tinygo to WebAssembly and I don't understand why the function took 17 minutes to execute while the same function in JavaScript only took 4000 ms. what I'm doing wrong? also ...
3
votes
1
answer
551
views
How to perform Wasm host call from a Go guest?
How can one call custom Wasm host functions from a Go guest?
I've looked at a few examples that show loading a self-contained witx/wat/wasm defined function, but haven't found an example for ...
3
votes
0
answers
408
views
How to use .witx definitions for Go code generation to use with TinyGo WebAssembly targeting WASI?
Is it possible to use .witx definition files for Go code generation to use with TinyGo's WebAssembly WASI (WebAssembly System Interface) support?
Specifically, I want to create a Fastly Compute@Edge ...
3
votes
1
answer
2k
views
How to return object from tinygo webassembly target
I am using tinygo to generate a wasm for simple function:
//export onInput
func onInput() map[string]interface{} {
return map[string]interface{}{
"key": 60,
"remove&...
3
votes
1
answer
3k
views
Envoy WASM failing to load due to missing import (using net/http Go module)
I'm trying to run my WASM Go filter to make an external HTTP call using the net/http module. Envoy fails to load the WASM code. Why is the import failing?
Envoy/Istio version: istio/proxyv2:1.11.4
SDK ...
1
vote
0
answers
1k
views
How to write in tinygo bluetooth with response?
I'm trying to use Tinygo Bluetooth to connect to a Timeflip v2 (https://github.com/DI-GROUP/TimeFlip.Docs/blob/master/Hardware/TimeFlip%20BLE%20protocol%20ver4_02.06.2020.md).
The API documentation ...
5
votes
1
answer
5k
views
Is it possible to make a Go binary smaller by compiling it with TinyGo?
The TinyGo Homepage says that it is designed for micro controllers (or MCU). I wonder if it is possible to use TinyGo to compile go into small binary for ARM/Linux system?
Currently with UPX --best --...
3
votes
1
answer
2k
views
How to decode a JWT token with TinyGo
We have a JWT token that we need to decode, the issue is that we are using TinyGo and some libraries are not supported,
How can it be done for TinyGo / core Go libraries which is already supported? I ...
0
votes
2
answers
78
views
Minimize integer round-off error in PLL frequency calculation
On a particular STM32 microcontroller, the system clock is driven by a PLL whose frequency F is given by the following formula:
F := (S/M * (N + K/8192)) / P
S is the PLL input source frequency (1 - ...
0
votes
1
answer
1k
views
LinkError: WebAssembly.instantiate(): Import #... module="env" function="memcpy" error: function import requires a callable
I'm building a Go wasm module (compiled with TinyGo) and it compiles fine. But when I try to run it in the browser I get the above error.