ohai.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A cozy, fast and secure Mastodon server where everyone is welcome. Run by the folks at ohai.is.

Administered by:

Server stats:

1.8K
active users

#embassy

6 posts6 participants1 post today

alojapan.com/1243896/embassies Embassies of Japan, Singapore share adorable Songkran videos #ambassador #BreakingNews #Embassy #Japan #JapanNews #news #Singapore #Songkran The embassies of Japan and Singapore in Thailand have released adorable and heartwarming videos to mark the upcoming Songkran Festival, or Thai traditional new year, on April 13. The video by the Embassy of Japan in Thailand features a Japanese version of a Songkran song, led by Ambassador Masato Otaka. …

FUCKING A!

I have a #Rust programme on my #RaspberryPi #PicoW that reads data (an u16) from a sensor and you can then get that data from a web request. HUGE ACHIEVEMENT.

It has taken me like… a large chunk of three days… To get to this point from having code that reads the sensor and serves web requests. 😂 I feel like a moron. But hey, I've only been coding Rust for ~5 days. Probably taking the hard path by going straight into embedded with no::std…

It has taken so many attempts to get to grips with scopes, mutables, Rust's bloody intense syntax, etc, etc… but in the end I've worked out a way to pass a u16 to both spawned workers via some sort of a Mutex. I think I might have an extra level of indirection I don't need… but fuck it, I'll take that I can do this at all as a win.

Now I can take it outside (i.e. not USB-tethered) and see what it reads as an outdoor CO2 PPM measurement.

(I could have had this working in C++ in… minutes, but no, I'm a masochist.)

Continued thread

RIGHT. Fucksake! Arghhh...

I have a solution to this, I do not like my solution to this, but it is a solution...

I reverted my project to use embassy from GitHub again.

I have then grabbed picoserve from GitHub and I have edited the relevant Cargo.toml to use the embassy packages from GitHub.

An in my project Cargo.toml I have referenced my downloaded and modified picoserve instead of using Crates.io... because no matter what I try I cannot make this work using Crates.io packages.

I have now successfully compiled the project modified to use picoserve, loaded it onto the #PicoW, and it runs and serves a "Hello World" via HTTP.

So, another #Rust #embassy #PicoW question.

I started out with embassy examples and had a working thing that compiled and ran on a Pico W.

But then I wanted to use picoserve and this ran me into some dumb looking dependency problems.

I fixed that by following advice to remove the git entries from my Cargo.toml.

However I then have a linker error, one that can be fixed by removing build.rs - but then I get a binary that doesn't work on the Pico W: "entry point is not in mapped part of file"

I think that this is because build.rs was adding these linker arguments: -C link-arg=--nmagic -C link-arg=-Tlink.x -C link-arg=-Tlink-rp.x.

Any one of these being there causes the linker error. I assume something is missing from what needs to be linked in, thus the "undefined symbol" errors. But WHY is this different with the only difference being getting the same versions of packages from git vs crates?!

Edit: hacked a solution, see down-thread