How to send data from raspberry pi to windows (email)? - raspberry-pi

I have finished my assignment with c language on raspberry pi, now l want to send it to my email in order to submit it.please l need help to how can do it.

Related

Counting input pulses with a raspberry pi 3 and showing the results

this is my first time working with a raspberry pi and also with structure code( full ladder coding here) My main objective is to connect 4 inputs on my raspberry pi GPIO, I need to count each pulse and display each one of them with a log (date and time) on a web page or any other suggestions to view the data.

Raspberry Pi 3 USB Bare Metal

I am working on the new Raspberry Pi 3 B+ board in a bare metal environment (32-bit). I have a working USB driver for the older Pi 1 boards. From what I understand, the Pi 1 and the Pi 3 B+ have the same USB host controller (Synopsis DesignWare 2.0 USB Host Controller; or dwc for short), yet the USB driver that works on the Pi 1 does not work for me on the Pi 3 B+ (or the Pi 3 B either).
After going through some debugging messages, I found that the problem is that when the DWC is enumerating the devices, it will try to read the device descriptor of, what I am guessing is, the on-board USB hub/ethernet device (LAN7515), but it will return a transfer error, and then therefore is unable to enumerate the device.
My question is why does this happen? If the Pi 1 and the Pi 3 have the same host controller then it should, in theory, at least be able to properly enumerate a device.
If someone can point me in the right direction as to why this happens, it would be greatly appreciated.
Thank you in advance.
The Pi3 is having an alignment issue because some of the USB structures are not natively aligned and they are packed. It generally requires inserting some pack and alignment attributes "attribute((packed, aligned(1)))" on some of the structures that are unaligned.
The rule goes
uint16_t* pointers must be reading/writing align 2 addresses
uint32_t* pointers must be reading/writing align 4 addresses
So a struct like this is misaligned.
struct BadStruct __attribute__((__packed__)){
uint8_t a;
uint16_t b;
};

Improving runtime of function in Matlab using raspberry pi package

We are using Matlab to control our raspberry pi 3 using the raspberry pi package.
we use this following code to rotate a stepper motor 100 steps:
clear all; close all; clc;
rpi1 = raspi;
cam1 = cameraboard(rpi1,'Resolution','1280x720');
pul_x = 5;
dir_x = 6;
ena_x = 12;
configurePin(rpi1,pul_x,'DigitalOutput');
configurePin(rpi1,dir_x,'DigitalOutput');
configurePin(rpi1,ena_x,'DigitalOutput');
writeDigitalPin(rpi1,pul_x,0);
writeDigitalPin(rpi1,dir_x,1);
writeDigitalPin(rpi1,ena_x,0);
for i = 1:100
tic
writeDigitalPin(rpi1,pul_x,1);
pause(0.00005);
writeDigitalPin(rpi1,pul_x,0);
pause(0.00005);
toc
end
Our computer connected to the network with lan cable, and the raspberry pi connect to the same network with lan cable aswell.
most of the time when we run this code the whole for loop takes around 40msec average, and there are sometimes that it takes around 8msec average but we are not sure why.
we think maybe it's because the network communication, and maybe there is other way to connect the computer and the raspberry pi to make the runtime faster but we are not sure how to do this.
We would like to get some advices about how to connect them directly, or if there are other suggestions we'll be glad to hear it.
Thanks in advance.
In the hardware setup screen for MATLAB Supportpackage for Raspberry Pi, you can select the option "Connect directly to host computer".
Refer this image.
This will create a direct connection between Pi and your PC. Once this is done, you will be able to access the Pi using the IP 169.254.0.2 (Only from your PC)

Interfacing ds18b20 with raspberry pi

i have a raspberry pi connected with two ds18b20 temperature sensor.
-sensor1 is fixed on the outside of my garage (distance 20m from raspberry pi)
-sensor2 is just connected in a breadboard near the raspberry pi.
Everything is working well.
I decided to add sensor3 located outside and from 20m from the raspberry pi.
Now when i type :
cd /sys/bus/w1/devices
if find this:
c0-40a000061005 c2-246056869800 c2-247056869000 d0-008000001000 w1_bus_master1
instead of :
28-.....
28-.....
28-.....
each sensor ref should be start with 28-.....
what is happening with my sensors?
If unplugged the sensor1, then everything is well
if i unplug the sensor3 and let only sensor1 and sensor2 everything is well.
Which modification do we have to do when sensor are located far from the raspberry pi?
thank you
That means that the 3rd sensor doesn't have a 4.7kOhm or 10kOhm resistor between VCC and the OUT wire (black/red one if you have 4wire DS18B20).
Just connect that resistor and it will work , I had the same problem . I spent weeks to find such an easy solution. And if you get the same code after you connected the resistor , that means you didn't connected it properly.Hope will help you

Raspberry B+ Power Supply calculation

I'm new to Raspberry Pi and I don't understand about electricity. I bought a Raspberry B+ today and a 5V 3A power supply, but I'm afraid to connect it because in several places I read about using 5V 2A power supplies. I believe that only higher voltages can damage the Pi but, since I don't know about Amp, I don't know if this is true for 3A too.
My ideia is create a mini-personal server in my home, running Pidora. For data, I have a 1 Tb external USB drive with no external power supply (Seagate model SRD00F1).
My questions are:
can I use the 5V 3A power supply on Raspberry Pi B+ without damage it?
this power supply is compatible with my external USB drive to keep it on safely?
Thank you!
The Raspberry Pi FAQ says that the B+ uses between 0.7 and 1.0 amps, and suggest a 1.2 amp power supply as a minimum.
Using a power supply with a higher amperage rating will not harm your Raspberry Pi. Devices only draw as much current (amperage) as they need. Any additional capacity is unused.
This is where your question about the external hard drive comes in. If you see in the FAQ, they suggest that you might want a larger power supply if you use all of the USB ports. Every USB device you plug in is going to draw more current. To figure out how much you need, you just add up the requirements of all of the devices like so:
Raspberry Pi = 0.7-1.0A
Mouse/Keyboard = 0.5A
Hard Drive = 1.0A
========================
TOTAL = 2.5A
(These numbers are all fake... be sure to check the requirements for your actual devices.)
So if your devices total 2.5A then a 3A supply will handle all of these plus some room for expansion. If all of your devices total 3.5A, maybe you need to consider a bigger one.