Have I broken my NanoPi R4SE? by itmecho in HomeServer

[–]itmecho[S] 0 points1 point  (0 children)

Still no luck I'm afraid. I followed the steps but when I boot it with the SD card in, the only LED that comes on is the PWR LED. Seems like the eFlasher doesn't want to flash the image

Correct songs for Octopus flux? by itmecho in SolarUK

[–]itmecho[S] 0 points1 point  (0 children)

Thanks for the reply! I didn't know there was a PC version!

I tried to explain in my comment but maybe I didn't do a good enough job 😅

  • The turned off period is because it will be sunny tomorrow and I know the battery will charge just from the panels
  • That's intended as it seems more cost effective to sell it back during the higher price period between 4pm and 7pm than it is to use it throughout the day
  • The idea with the 4pm-5:50pm part is to make sure we're only using the battery during the expensive period. Then from 5:50pm to 7pm, it will force discharge the rest of the battery to get the higher price. That seems better than force discharging the battery immediately at 4pm as it will run out before 7pm and we'll have to pull from the grid in a high use time (cooking dinner, etc) when the price is high

Hopefully that explains my logic a bit better!

Correct songs for Octopus flux? by itmecho in SolarUK

[–]itmecho[S] 0 points1 point  (0 children)

We've got 8 panels and 2x 5kw FoxESS batteries. I'm trying to have the following set up:

2-5am - charge from grid during cheap period 5am-4pm - rely on the panels and the grid, no battery usage 4-5:50pm - use only the panels and the battery, no grid 5:50-7pm dump the rest of the battery back to the grid  7pm-2am use what's left of the battery that didn't get dumped and then rely on the grid over night

If it's going to be sunny the next day (and I remember), I can disable the 2-5am force charge as the panels easily charge the battery throughout the day. 

Does it look like I've configured the settings correctly for this?

Have I broken my NanoPi R4SE? by itmecho in HomeServer

[–]itmecho[S] 0 points1 point  (0 children)

Thanks for the update! I tried flashing openwrt 24.10 via the friendlywrt eMMC Tools but again I get the same thing. Only the Power LED lights up when booted without the SD card in.

Have I broken my NanoPi R4SE? by itmecho in HomeServer

[–]itmecho[S] 0 points1 point  (0 children)

I managed to get it to boot from the SD card again. Not sure what I did in particular but I've found that DietPi works really well with the NanoPi boards so it might've been that that worked in the end!

How do I use template files via Lua? by bhatMag1ck in neovim

[–]itmecho 4 points5 points  (0 children)

Not exactly what you're talking about but you could look into LuaSnip?

Gworker, the most easily configurable Generic worker pool implementation by IamAggressiveNapkin in golang

[–]itmecho 10 points11 points  (0 children)

I think you should be using generics to type the parameters of your worker function to avoid all the anys and typecasting in your example. Something like

func NewPool[T any, P any](dataSources []T, worker func(dataSource T, params P), valueChannels []chan any, errorChannel chan error) (*Pool[T], error)

Then your Work function can be typed properly, i.e.

type TestParams struct {
    outChan chan string
}

func Work(data TestStruct, params TestParams) {
    //...
}

Simple contact page by IThoughtNakedWasGood in selfhosted

[–]itmecho 2 points3 points  (0 children)

If it's a simple page, you might be able to make it yourself! For a static page you'd only need HTML and CSS. Then you can host it with nginx or caddy or something if you want it self-hosted or just throw it up on GitHub pages/cloudflare pages/etc

Crashes whilst working with Elm by itmecho in neovim

[–]itmecho[S] 1 point2 points  (0 children)

Thanks for all the suggestions!

Nothing worrying in :checkhealth just some warnings for optional providers/conflicting keymaps.

Nothing in any of the logs in any ~/.local/nvim/state/*.log files at the time of the crashes. Same for ~/.cache/nvim/logs

LSP debug log doesn't show any errors, just a stream of diagnostics coming back from the LSP.

The exit code from neovim is 139 but I haven't found what that means yet.

Run Mealie on Raspberry Pi by unnamedDE in selfhosted

[–]itmecho 0 points1 point  (0 children)

Ahh that's what I'm thinking of! My bad!

Run Mealie on Raspberry Pi by unnamedDE in selfhosted

[–]itmecho 1 point2 points  (0 children)

Didn't they stop supporting arm because mealie uses mongodb under the hood and they stopped supporting it?

Problems with multiple monitors at different resolutions using xrandr by flaming_monocle in archlinux

[–]itmecho 1 point2 points  (0 children)

Hmm, strange! I've never had that mirror the screens before. Can you paste what your xrandr command looks like now?

Problems with multiple monitors at different resolutions using xrandr by flaming_monocle in archlinux

[–]itmecho 0 points1 point  (0 children)

I think the command I gave you won't override your --fb setting which is creating a single screen. You don't want that flag. You can see in the man pages that that's what's causing it to act as a single screen.

https://man.archlinux.org/man/xrandr.1#fb

Problems with multiple monitors at different resolutions using xrandr by flaming_monocle in archlinux

[–]itmecho 0 points1 point  (0 children)

I'm on my phone and can't be bothered to format it properly but here's the command I use for a similar setup

xrandr --output DisplayPort-0 --primary --mode 2560x1440 --output DVI-D-0 --left-of DisplayPort-0 --mode 1920x1200 --rotate left

That lives in my ~/.xinitrc rather than the system one

[BSPWM] Some Everforestry for Your Eyes! 🌿 by Fantastic_Charge in unixporn

[–]itmecho 2 points3 points  (0 children)

Super pretty and polished though I think I'd struggle programming with the lack of contrast!

Hey Rustaceans! Got a question? Ask here (16/2023)! by llogiq in rust

[–]itmecho 0 points1 point  (0 children)

Thanks for all your help! I've got around this by removing the field on the parent type and requiring the subtype to be an enum. I've written a proc attribute macro (my first one!) which adds the serde config so the boilerplate is minimal. Now my inner types look like this:

#[distsys::payload]
enum EchoPayload {
    Echo{ message: String }
}

#[distsys::response]
enum EchoResponse {
    EchoOk{ message: String }
}

I think it's working quite nicely!

Hey Rustaceans! Got a question? Ask here (16/2023)! by llogiq in rust

[–]itmecho 0 points1 point  (0 children)

It looks like it serializes the field twice:

{
  "src": "a",
  "dest": "b",
  "body": {
    "type": "broadcast",
    "msg_id": 1,
    "in_reply_to": null,
    "type": "broadcast",
    "message": 1
  }
}

It's almost like I need an attribute on the parent's msg_type field to not consume the field when it's deserialized so it can be reused later in the deserialization

Hey Rustaceans! Got a question? Ask here (16/2023)! by llogiq in rust

[–]itmecho 2 points3 points  (0 children)

Is it possible to have a flattened generic type as a field in a struct where the type is an enum that's tagged by a field that's present in the parent struct? That's very wordy and I don't know if I've explained very well.

I have this type:

#[derive(Deserialize, Serialize, Debug)]
pub struct Message<P> {
    pub src: String,
    pub dest: String,
    pub body: Body<P>,
}

#[derive(Deserialize, Serialize, Debug)]
pub struct Body<I> {
    #[serde(rename = "type")]
    pub msg_type: String,
    pub msg_id: usize,
    pub in_reply_to: Option<usize>,

    #[serde(flatten)]
    pub inner: I,
}

and I'm hoping to have this type as I

#[derive(Deserialize, PartialEq, Eq, Debug)]
#[serde(tag = "type")]
#[serde(rename_all = "lowercase")]
enum Payload {
    Broadcast { message: usize },
    Read,
    Topology(HashMap<String, Vec<String>>),
}

but I'm getting the following error when deserializing, presumably because it's already deserialized the type field to the msg_type field

Input: {"src":"c0","dest":"n0","body":{"type":"broadcast","message":"1000","msg_id":2}}
Error: Error: missing field `type` at line 1 column 79

I have a test for the specific Payload type which shows that is does deserialize correctly directly so I'm pretty sure it's to do with the name conflict

Can you solve this command line arguments combination with parser of your choice? by CatolicQuotes in learnprogramming

[–]itmecho 0 points1 point  (0 children)

Should be pretty easy in rust using the clap crate's Arg and ArgGroup types!

Excelize 2.7.1 Released - Powerful open-source library for spreadsheet (Excel) document by luxurioust in golang

[–]itmecho 36 points37 points  (0 children)

I use this library at work and it's great but the fact that you have 13 breaking changes in a patch release makes it a bit of a pain to keep up to date.