SK Pang Electronics RSP-PICANGPS User Manual

Can-bus board for raspberry pi

Advertisement

Quick Links

Product name
Model number
Manufacturer
PiCAN 2 GPS Rev B V1.1
PiCAN GPS USER GUIDE
PiCAN GPS CAN-Bus Board for Raspberry Pi
RSP-PICANGPS
SK Pang Electronics Ltd
SK Pang Electronics Ltd Ó 2020
www.skpang.co.uk
V1.1
1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the RSP-PICANGPS and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for SK Pang Electronics RSP-PICANGPS

  • Page 1 PiCAN 2 GPS Rev B V1.1 PiCAN GPS USER GUIDE V1.1 Product name PiCAN GPS CAN-Bus Board for Raspberry Pi Model number RSP-PICANGPS Manufacturer SK Pang Electronics Ltd SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 2: Table Of Contents

    External GPS Antenna and Backup Battery ................... 4 Software Installation ....................1.8. Basic GPS Test ..............................6 1.9. Using GPSD ................................7 1.10. External GPS Antenna ..........................8 1.11. Bring Up the CAN Interface ........................9 Writing Your Own Software ..................1.12. Application in Python .......................... 1 0 1.13. Application in C ............................. 1 1 SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 3: Introduction

    • Standard and extended data and remote frames • CAN connection via screw terminal • 120Ω terminator ready • Serial LCD ready • LED indicator • Four fixing holes, comply with Pi Hat standard • SocketCAN driver, appears as can0 to application • Interrupt RX on GPIO25 • MTK3339 chipset • -165 dBm sensitivity, 10 Hz updates, 66 channels • RTC battery holder • Fix status LED • On board patch antenna • uFL connector for external active antenna 2. Hardware Installation Before installing the board make sure the Raspberry is switched off. Carefully align the 40way connector on top of the Pi. Use spacer and screw (optional items) to secure the board. SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 4: Screw Terminal

    GND CAN_H CAN_L 1.3. 120 W Terminator There is a 120W fitted to the board. To use the terminator solder a 2way header pin to JP2 then insert a jumper. 1.4. LED1 There is a red LEDs fitted to the board. This is connected to GPIO04. It can use as a general purpose indicator. 1.5. LED2 The LED blinks at about 1Hz while it's searching for satellites and blinks once every 15 seconds when a fix is found. 1.6. Not Fitted Items J2 can be use to power a serial LCD with data on TXD line from the Pi. There is also 5v supply on J2. 1.7. External GPS Antenna and Backup Battery An external GPS antenna can be fitted via connector X1. This is an uFL connector. A uFL to SMA cable adapter is normally required. A backup battery can be fitted for the RTC and help to reduce fix time. SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 5: Software Installation

    PiCAN 2 GPS Rev B V1.1 3. Software Installation The following procedure is for the Raspberry Pi 3. It is best to start with a brand new Raspbian Jessie image. Download the latest from: https://www.raspberrypi.org/downloads/raspbian/ After first time boot up, do an update and upgrade first. sudo apt-get update sudo apt-get upgrade sudo reboot Add the overlays by: sudo nano /boot/config.txt Add these 4 lines to the end of file: dtparam=spi=on dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25 dtoverlay=spi-bcm2835-overlay enable_uart=1 Edit the cmdline.txt by: SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 6: Basic Gps Test

    That is remove console=serial0,115200 Reboot Pi: sudo reboot 1.8. Basic GPS Test The raw data can be read by: stty -F /dev/ttyS0 raw 9600 cs8 clocal –cstopb Now read the data cat /dev/ttyS0 If you see the data with lots of commas then it means the module has not got a fix yet. Make sure the GPS module has a clear view of the sky. Alternatively connect an external GPS antenna to the board and place the antenna outdoor. You should see something like this: SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 7: Using Gpsd

    PiCAN 2 GPS Rev B V1.1 1.9. Using GPSD A program called GPSD can be use to view the data in a formatted way. To install GPSD, type: sudo apt-get install gpsd gpsd-clients python-gps You need first to disable systemd service that GPSD installs: sudo systemctl stop gpsd.socket sudo systemctl disable gpsd.socket To start GPSD, type: sudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock gpsmon You should see this screen: SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 8: External Gps Antenna

    PiCAN 2 GPS Rev B V1.1 1.10. External GPS Antenna The PiCAN-GPS board has built in patch antenna which provides a -165dBm sensitivity. However if your project is in a box and does not have a clear view of the sky then an external antenna is more suitable. The optional external antenna has a SMA connector and an uFL to SMA cable adapter is required. SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 9: Bring Up The Can Interface

    1.11. Bring Up the CAN Interface You can now bring the CAN interfaces up: sudo /sbin/ip link set can0 up type can bitrate 500000 Download and copy the CAN test programs to the Pi. sudo apt-get install can-utils Connect the PiCAN2 to your CAN network via screw terminal. To send a CAN message on can0 (CAN B J4) use : cansend can0 7DF#0201050000000000 This will send a CAN ID of 7DF. Data 02 01 05 – coolant temperature request. To send a CAN message on can1 (CAN A J3) use : cansend can1 7DF#0201050000000000 Connect the PiCAN to a CAN-bus network and monitor traffic by using command: candump can0 You should see something like this: SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 10: Writing Your Own Software

    Bring the CAN interface up if it is not already done: sudo /sbin/ip link set can0 up type can bitrate 500000 Now start python3 python3 To sent a message out type the following lines: import can bus = can.interface.Bus(channel='can0', bustype='socketcan_native') msg = can.Message(arbitration_id=0x7de, data=[0, 25, 0, 1, 3, 1, 4, 1], SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 11: Application In

    PiCAN 2 GPS Rev B V1.1 extended_id=False) bus.send(msg) To received messages and display on screen type: notifier = can.Notifier(bus, [can.Printer()]) 1.13. Application in C Bring the CAN interface up if it is not already done: SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...
  • Page 12 /sbin/ip link set can0 up type can bitrate 500000 Download the source code and example files by typing the following in the command prompt: wget http://skpang.co.uk/dl/cantest.tar Unpack the tar file and change into directory by: tar xf cantest.tar cd linux-can-utils The example file is called cantest.c to edit this file, type the following in the command prompt: nano cantest.c Line 77 is the CAN message to be sent out. unsigned char buff[] = "7DF#0201050000000000"; 7DF is the message ID and 0201050000000000 is the data. Change the data to suit. Press CTRL-X to exit. To compile the program type: make Check there are no errors. To run the program type: ./cantest SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk...

Table of Contents