Working with PiCAN + raspberry pi 3 running windows IoT Core - driver

I want to connect the PiCAN with my raspberry pi3 running windows IoT Core. I think I need a universal driver for the mcp2515 to work with the windows in Pi. I already tried using the instructions given in https://developer.microsoft.com/en-us/windows/iot/docs/driverdeployment to deploy the driver given in https://github.com/AustinWise/Mcp2515Can . But I got stuck in the instructions. I hope someone has already done this and maybe can help me with it? Did anyone successfully use this CAN board with Raspberry Pi (windows iot core)?
Thank you :)

Is a driver required in the first place?
Short answer is No.
Although a device driver is preferred, such work is not officially or community done yet.
The benefit you get from developing a device driver might include:
Native OS support for PiCAN board.
Create your create the custom IoT image, and deploy it to Microsoft store.
Possible performance improvements
others…
However, in order to develop an device driver, you need to follow the WDK framework. If you are comfortable with picking up new stuff, go ahead and try it out. You might need to refer to the linux source driver code for WDK driver developing.
If your purpose is to get the board working, you don’t need to get yourself into all these troubles.
In fact, you only need to get the SPI controller and GPIO controller, open the SPI device and initialize GPIO interrupt pin like Mcp2515Can does.
But, even after enabling the SPI, I couldn't receive anything on the
Raspberry Pi.
First, you can use Raspbian and turn on the CAN driver support to verify that you got all the wirings right. Here is the user guide you can reference.
If you can rule out the possibility of hardware failures, step into your C# code to troubleshoot the software.
Good luck.

Related

Raspberrry Pi 3 + Windows IOT Core crashes after some time

Im developing an uwp app on Raspberry Pi 3 with Windows IOT Core. But after I deploy my app and use it for couple days the os crashes. It says something went wrong. It says "Your pc ran into a problem and needs to restart". It restarts couple times but still same error on every boot.
I tried to remove the sd card(Class 10,64 GB) format it and reinstall everything. At first it was okay but after some time same error appears.
I tried to use different os builds and it didnt work.
I tried to use industrial power supply (5V3A) and also it didnt work.
My SD Card is not one of the recommended ones but do I really have to get the recommended sd cards to use the windows iot core properly?
"Your PC ran into a problem and needs to restart" is a typical blue screen message seen on Windows systems from the last few years - laptops and desktops with far larger hard drives and no SD card. The error is not associated with a RAM or disk space shortage (operating systems running in graphical mode usually monitor and actively warn about either). In your case, it is showing at startup, when not much is running (taking up RAM), and you can check the amount of space used on the card with the PC.
The key stats for SD cards are size (you have plenty) and speed (clearly enough or you would have trouble installing/running anything after starting the Pi). The cause is something else, and finding out what will require getting a more detailed error message from Windows - "a problem" could mean anything. In my experience, blue screen errors have mostly involved having a wrong driver installed, sometimes a bad Windows update - but IoT Core has its own alternatives, like "bad system configuration". Look for the underscored string (e.g., BAD_SYSTEM_CONFIG_INFO) at the end of your blue screen message, as that is the first hint.
Unfortunately, most Windows BSoD documentation is for traditional PCs, so I cannot recommend specific troubleshooting tools and be sure that they will run on the Pi.
You can use Windows Debugger to debug the kernel and drivers on Windows IoT Core. WinDbg is a very powerful debugger that most Windows developers are familiar with. Or you can also refer to this topic in MSDN, it shows how to create the dump file when the app crashes. If possible, you can share your code so that we can reproduce the issue.

Is it possible to access a Chromebook via ssh through USB?

My employer has asked me to prepare for testing several thousand Chromebooks (mix of models/manufacturers) to refurb/flip. This may be a recurring thing.
Most or all of these will be old enough that CCD will not be available. I'd like to connect a widget such as a Raspberry Pi to the USB and have it automate testing as much as possible.
I know I can use keyboard emulation to inject commands, but I'd like to get a crosh session running over USB so that I can read info from the DUT besides just controlling it.
Google shows bazillions of returns about using a Chromebook as an ssh terminal but what I'm looking for is the opposite. I'm prepared for the answer to be a simple "no" but I'm concerned because I can't find that anyone else has asked this question. I don't think I'm that creative, so I suspect my Goog-fu is weak.
The answer appears to be "no". However I solved it another way; using "gadget mode" I have a Raspberry Pi ZW enumerate as a keyboard and a serial port. I put the Chromebook into Developer mode, open a developer shell with ctrl/alt/F2, or on a PC/linux or Mac system open a terminal window and type "sudo su" (these have to be done manually). Then I have the RPi issue this bash command to identify the serial port "in the blind":
SERPORT=/dev/serial/by-id/$(ls /dev/serial/by-id) # Chromebook or PC/linux
(or)
SERPORT=$(ls /dev/cu.usbmodem*) # Mac
Now I can have the RPi inject commands via the keyboard, put ">$SERPORT" on the end of each command, and the output comes in the RPi gadget serial port. The RPi then packages the data and forwards it over WiFi to our CRM. It's working nicely for Chromebooks, PCs booted into linux, Mac desktops and Macbooks.
Edit:
The company I work for has actually turned this into a product and so I'm not sure how much detail I should share, but...
I learned my way around gadget mode on the RPi from this link. There are examples for setting up a keyboard and a serial port. Using the templates in that link, I made a device called /dev/hidg0 which emits keyboard scancodes from the RPi to the Chromebook. I also made a device called /dev/ttyGS0 which the Chromebook sees as a serial port.
So I send keystrokes with some python like:
with open("/dev/hidg0","bw") as hid:
hid.write(blah)
and then have the Chromebook send text to the serial port, which I then read by looking at /dev/ttyGS0
Hopefully this will be enough to get you started. I found the isticktoit link very helpful.

Communicating between a Lightroom plugin and an iOS app over a LAN

I've asked this on Adobe's LR SDK forum, thought I'd ask here as well.
I want to create a plugin for Lightroom 6+ that allows two-way communication to take place between a LR plugin and an iOS app. The iOS device would be on the same local network.
What is the best method of accomplishing this? I was thinking about using LRSocket, this is the most direct method? I assume with this method the iOS app would need to act as the server and the LR plugin would be the connecting client? But, all the documentation and examples I’ve found, regarding general LRSocket usage, imply that localhost is used. This would make direct communication with an iOS device over WiFi impossible if it can only use localhost?
Any information would be appreciated.
I've just started out trying to do the same thing, albeit with an Android app, and run into the same (apparently insurmountable) issue that LrSocket.Bind only seems to be able to bind to the localhost interface.
The only way I can think to get around this is to have an intermediary port forwarder on the LR host OS that forwards traffic between localhost:port and ethernet/wifi:port
You could use ssh on a mac, I guess, and there are port-forwarding applications for Windows (ssh is allegedly coming soon). PassPort (an old application from the XP era still seems to work).
It's a bit....messy, though.
Another option would be to use LrHttp.get (and/or .post), but that's going to have to poll for information, and may be a bit laggy for some requirements.

Windows 10 IoT - Raspberry pi 2

I have to build a rover which has a camera on it and through webcam samples i am able to view the preview of it. I also came up with another app with has controls for the rover's motors. It works fine when i connect this device to a monitor and work with it, but for my purpose it needs to be headless. Is there any way i could remotely access the application. I am stuck up with so many different solutions like duplicating the entire project as webpage or could open the same application is the development machine that they communicate with each other. All i have to do is remotely control the rover with a video preview and even lower fps is acceptable.
There are a lot of ways to do this. (As #BerndGit implies.)
The easiest (IMHO) is to SSH in to the RPi from another computer and forward X11. That second computer will need to be configured for accepting X11 sessions.
Look for "SSH X11 Display Forwarding" for details on how to make this work on your setup.

XNA Game networking on a host PC and a virtual one

I'm relatively new to c# and the XNA, but using several tutorials and books I succeed at creating a simple game. The problem is, that i have only one computer and i want to test the game's networking features. So i have installed VMware Workstation and created a Virtual PC running Windows 7 Professional x86. On my host PC I'm running Windows 7 x64. I bridged both PC's and now i can share files between them flawlessly. But unfortunately when i run my game on both of them, create a session on the first, it seems that the second can't find and join that session. I tried to run another games like Quake and the result was the same - it looked like both PC's don't see each other. I also tried with installing Hamachi on both machines - no result again.
So my question is - is it possible to run XNA game which uses Windows Live for creating and joining a session on a host PC and virtual one.
Thank you in advance :)
make sure to use bridged networking in VM settings.
you can then specify different IP's on host / guest.
Also, try to stick it with IPv6
If you're just trying to test networking features and not simulate lag you can run multiple clients on 1 computer.
You should be able to find the session just the same as if you were running over the net/Lan.
Note:
Personally I've only done networking with Lidgren's network library so I'm not sure if using XNA's built in library works the same but it could be worth a try.
Edit:
Thought it was worth mentioning if you're running in the editor it won't let you run multiple clients directly, so publish your game to a local folder and run from there. You can also run one from the editor to get any debug messages or exceptions that occur.

Resources