M2 board and Pi 4, powered by OBD2 pin 16?

Hello, greetings, and wattup. :slight_smile:

I recently acquired an M2 (just the board itself) and I have a pi 4. The pi 4 is part of a prototype for a cool project I am working on, which for the time being I am trying to kind of keep under wraps, but yeah. I am really excited to play around with the M2 and see if/how it will fit into my project.

Now, the Pi 4 needs 5v and like 3 amps if I am not mistaken to run. Pin 16 provides 12v +/-1, and I noticed the breakout board has a +5v output. Has anyone powered their pi through the GPIO or SPI with the M2? I remember reading something about it a while ago, and of course I don’t want to just hook it up. I have been looking around but I figured it never hurts to ask if someone else has done it too. :slight_smile:

If it works, I am likely going to pair it with a small battery, and set it up so when it senses loss of the 12v or 5v signal on either board, it will gracefully shutdown. I have done that on another pi, though it was hardwired to the fuse block with a power conditioner/voltage regulator. It worked well enough. Figure this shouldn’t be too dissimilar.

So yeah. I am open to other ideas too but so far the combination of this M2 board giving me the hardware tools to communicate with a LOT of stuff, and the Pi with it’s computing power, just seemed like the right way to go, but hey; it’s a prototype, and I can pivot how I want since it’s my project. haha.

Go check out the schematics for details is the best answer.

Also does your Pi 4 have the two necessary CANBUS receivers onboard?

If not you may be working on a project that is going no where. Or you will need to find a compatible board to put on.

Adding support for the M2 interface board is not as easy at it might appear on the surface. But you really need to read and understand the schematics for the M2 interface board and see how it interfaces to the CPU board. If you are not real solid with electronics you may want to consider the P1 board. This board should be able to do pretty much anything that your Pi4 will do.

I did, and figured I would just use my arduino and canbus shield, but I am just going to buy the processor board for the macchina, as that just flat out seems like an easier solution. lol. This is just something I am playing with, too, as I am going to keep fine tuning the prototype until I am happy with the features, then get a custom PCB made with the things that I want.

Ok so I have the cpu board. But something struck me as funny about you saying that the board will pretty much do anything the pi can do. That is not true at all, as they are two completely different t devices. The m2 cannot run a full operating system like debían. I want my pi to run and interact with the m2. It’s something I want to explain but I’m not trying to go into details of my project. My question is that since the m2 is powered. By the obd2 port itself, does it provide enough power out of the 5v output to power the pi? Just curious if anyone has done it or anything. I’ll dig into it today and see what I come up with. Thanks.

Please be careful when responding that you read and understand what you are responding to.

The P1 configuration uses the M2 interface board but uses a different CPU board. It has an adapter to mount a PocketBeagle to the original M2 interface board. The P1 configuration most definitely will do most if not everything that a PI will do.

While the M2 is Arduino based and doesn’t have a true OS, the P1 has most if not all the same functionality of a PI board with the CANBUS ports built in. While not as well developed as the PI, the BeagleBone series has their own strengths and weaknesses against the PI. And most definitely runs standard Linux.

You are correct, I didn’t fully understand… Though, because this project I guess is fairly new, short of the docs you have and forums, the info about what things do and don’t do are quite sparse. Thing is, i already have a pi 4, and don’t want to spend more dough on another board right at the moment (though in the time since I posted this, I have purchased the test board and the cpu board), which is what I was originally asking about. I mean, perhaps I can get an olive branch besides “just read the docs”? I want to interact with the community, not just RTFM. :wink: Though if this is going to be like a HondaTech forum, I will gladly stay off of the forums and steer clear of grabbing anything more, whether it be an olive branch, gear, or a pull request (I am a compitent engineer and am “solid with electronics”. Have been working with them for my whole life (8 y/o to 35 y/o). Compounded by the fact that your insinuation that I am working on a project that “may be going nowhere” without knowing aaaannnything about it, what I have done (thousands of lines of code, a full suit of modules and libraries written by hand, an interface that is absolutely cross-platform, and doing all of this in a way that I literally have never seen anyone do before in my 18 years of working on and tuning cars, as well as building my own PoC hardware in a week with no glitches first try)… well, is disheartening. Besides telling me to use/buy the p1 configuration, you have only told me to RTFM. I have since got my answer, but again, pretty “bleh” answers and responses when I am coming in, new to the community, asking for help/advice or just a general consensus… maybe I was bored too and wanted someone to talk tech with? Isn’t that what a community is for? We share a similar interest? Maybe engaging in conversation instead of casting doubt, offering little to no help for the question at hand, and basically saying "seems like you don’t know what you are doing… "… Hmmm. Idunno.

Anyway, thanks for your help. have a good night. :wink:

You are taking what I said far to personally and need to chill out.

I was making a point that the PI does not have the CANBUS ports on it. I am NOT a hardware guy which is why I said read the schematics. While I have a very basic knowledge of electronics I am far from an engineer and can not explain to you how to interface a PI board into the M2. The “Going no where” comment was simply pointing out that there is additional hardware you need that the PI doesn’t come with. I was saying you had to add additional hardware that the interface and your PI doesn’t have. Throwing a CANBUS board onto your PI can help but would likely require major reworking of the board.

If you are capable of being able to create your own boards and such directly then you are FAR beyond my ability and my trying to suggest anything other than pointing out the hardware i KNOW the PI doesn’t have is not going to happen. Then the best thing I can do is point you to the schematics and ask you to look through them. It would be the same thing I would have to do and you obviously would understand them a whole lot more than I would.

A number of the devices listed on this site are in development stages and there isn’t full documentation made for them. If you came here looking for finished products that are fully documented you will be disappointed. But then again that is pretty much the case with any of the devices out there.

Please note that I am not a Machinna Employee. Just happen to follow a bunch of what goes on and hopefully will be able to help get the software side of things going a little bit more. If I know the answer I am more than happy to oblige in providing that answer. If I don’t, but I know where you point you that is what I will do.

1 Like

I’m new here (just ordered a P1 last night for some initial work on a project) - but if you’re as solid with electronics as you say, I would assume you are familiar with the concept of a network MAC and a network PHY?
Just like Ethernet, most CAN setups have a separate MAC and PHY.
The Macchina interface board was designed for a CPU that had two CAN MACs already, and as a result, it has two PHYs and a third MAC+PHY combo for the single-wire CAN (plus some other stuff)
If you use a CPU that has no MACs (such as the raspi), then you need to find a way to add the MACs. Nearly any CANbus board for the Pi has the PHYs attached to the MACs already, which is a problem for you.

The raspi has some great qualities, but it isn’t a very good CANbus development setup because of the fact that the Broadcom CPUs used in the Pis were designed for set-top boxes and thus have no CAN support.

TI, on the other hand, has focused almost exclusively on automotive/industrial embedded since they pulled out of mobile, so the Sitara family all have automotive/industrial features like CANbus MACs.

This is the reason the AM335x in the P1 CPU board works with a fairly minimal adapter board between it and the Macchina interface board.

That said, it looks like long-term my planned project will eventually require moving to an M2 CPU that interfaces with something else via USB or serial, because there’s no good way to put the AM3358 into a deep sleep that would allow it to be woken when a CAN message is seen without buffering the messages in an offboard processor (such as the Cortex-M in the M2’s CPU board).

You guys really got a problem here with attitude, first off. Second, you guys keep answering questions I never even asked. All I wanted to know was if I could power a pi from the power coming out of an m2. That’s all. I have had my question answered and am also using the pi4 and m2 together how I want it to. The thing I’m building is not a final product in any way shape or form. It’s a PoC. Just something to flesh out the idea. In the end I may not use either device.

I also said that I have the m2 cpu board as well. I know the pi has no native can support besides being able to run socketcan… The pocketbeagle is incredibly under powered for what I need it for, plus I already have a pi 4… and the m2… Playing very nicely together… And it works. Don’t over think how I did this mysterious voodoo. Like why do I care that the pi has no native can hardware? You guys assumed way too much, and again, started answering all sorts of things I didn’t ask nor care about.

I’ll not be coming back here. Very disheartening.

@RoninDusette - I am sorry you are not feeling welcome. I am thinking the best thing I can do to mitigate that would be to help get clear answers posted more quickly and improve documentation overall for everyone. I can understand the frustration of not finding clear answers but I know that everyone on this forum are here to help.

I know you said you already figured this out, but just in case: M2 interface board uses the TPS54328 buck converter that provides 5V at up to 3A. See page 3 of this schematic.

Your RPi should be able to run off that no problem.

Good luck on your project! I encourage you to post up your findings and show off what you built!

In the meantime, let us know if there is anything we can do to help.

Thank you for the info. I appreciate it and I appreciate you showing some civility. I am an open source contributor (was a playonlinux admin and developer for like 7 years up until recently when I just simply became too busy to maintain my station. Though I still do handle Ubuntu trouble tickets that come in for the team when I see them.), so I want to contribute, I’d love to share things I come up with but the condescending answers, I was put off immediately. You convinced me there are still some nice people out there (plus my given name is Josh too, so that’s a win. Lol). Thanks for renewing my faith in humanity and at the least this forum :slight_smile: