Its clear that the physical and data link is covered by CAN. But does all of the upper layers covered by CANopen? Should it cover all?
What confuses me more that there are sewveral CiA documents (such as CiA DS 301, 303-1 ...). Which document(s) describes the protocoll called CANopen?
The mid layers (3 to 6) of the OSI model mostly apply to the various Internet protocols and aren't very meaningful to apply in the context of CAN buses.
The most important part to understand is that CAN is only the 2 bottom layers and not some stand-alone communications product. "We must use CAN as our communication protocol" is thus a nonsense requirement unless also specifying which application layer to use.
For the most part, CANopen is an applications layer.
Some parts of CANopen could be said to belong to the lower layers, like for example segmented SDO, which is used as a carrier protocol, belonging to the transport layer. Similarly, automatic re-transmission as mandated by the CAN hardware could be said to belong on the transport layer as well.
More info can be found here: https://www.can-cia.org/can-knowledge/
Related
Background
I'm very new to electronics/IoT dev. I'm trying to create a solution to be able to read my wife's Car's CAN Bus signal (messages) and store it to an SD card. I hope to analyze the data and build a dashboard based on the car's telemetry.
This specific question is in relation to a chip (STM32F1) on an IoT board (MXChip AZ3166) I already own, which I hope to incorporate into my overall solution as the data acquisition layer.
For reference the:
Chips is the: STMicroelectronics STM32F103C8T6, 32bit ARM Cortex M3 Microcontroller
and the IoT board is the: (MXChip AZ3166 IoT DevKit)
Reading the MXChip AZ3166 board's spec and after doing some research, I have found out that the MXChip AZ3166 comprises two main chipsets:
Vendor
Part Number
Ref Link
STMicroelectronics
STM32F103C8T6
https://uk.rs-online.com/web/p/microcontrollers/1023545
MXChip
EMW3166
https://www.mxchip.com/en/products/module/54
Main Question
The product specification mentions the STM32F1 features Comprising of motor control peripherals plus CAN and USB full speed interfaces, it also states it has 1x CAN Channel. Does that mean I can interface the MXChip AZ3166 board featuring this chip via the GPIO pins to the CAB bus in my wife's car and receive the CAN Bus signals (I presume adhering to the
ISO 11898-1 CAN data communication protocol).
How would I find out which pins to connect to the CAN Hi & CAN low connections on the cars CAN Bus?
Concerning power, how would I determine that the CAN signal received doesn't fry the MXChip Board with a stated max Operation voltage of 3.3v?
Yes you'll want an MCU with a built-in CAN controller for communicating on a CAN bus. However, the CAN standard only covers the physical and data link layers. You need to know the application layer in order to meaningfully interact with a bus.
The application layer on a car may or may not be proprietary. It may even be encrypted. If you don't know what protocol is uses, then no can do. Reverse-engineering CAN protocols is hackish, hard and dangerous. Plugging into a CAN bus where you have no clue about timing considerations etc is also very dangerous.
But cars usually have an "on-board diagnostics" (OBD) port used for service purposes, with standardized application layers, through which you may have access to various parts of the car. There's lots of different standards for OBD and older ones didn't even use CAN. It depends on the car model.
In case of the OBD port the pinouts are standardized and you can find them on the Internet. Otherwise it is very simple to find out which signal that's CANH and CANL with an oscilloscope. CANH goes 2.5V +1V and CANL 2.5V -1V. A more hacky solution is to measure this with a multimeter, but it's perfectly possible since one signal with be slightly above 2.5V and the other slightly below.
CAN is standardized so if you have a CAN bus on the board, you connect there. In some cases there may be 12V supply wired together with the signal and that's the only one which could fry something.
Overall, please note that the project you describe here is very difficult and not a beginner task. It sounds as you have next to no experience of electronics/embedded systems, so I would recommend picking a far simpler project.
Furthermore, modifying car electronics or installing your own electronics in a car is illegal in most parts of the world. Third party type approvals with EMC tests are mandatory (and very expensive). If your car is involved in an accident and they find custom electronics without type approval in it, you could be facing serious legal consequences.
We are building Electric Vehicle for Formula students competition, for communication protocol between modules we have to use CAN method. Do we need every module to know data from the other modules. For eg. we are using Micro-controller raspberry pi Pico to collect data from sensor and based on data perform action by same microcontroller itself. But CAN method says that data should be routed and shared in network where other receiver would collect. so one thing we thought was to use one microcontroller to collect data from all sensor and share data with CAN controller to another micro-controller to perform the action. But it is increase in complexity, and CAN was designed to reduce complexity. so I am confused how to apply CAN protocol. I am not getting when some data where it is collected can be used then why do we have to share. Or may be i am just going wrong so please help to clarify this concept. thank you.
CAN Bus and the upper layer protocols based on it (like CANopen) generally provide a messaging medium for publisher & subscriber pattern.
Publisher Nodes: They produce data and publish this data to the bus.
Sensor nodes are good examples of publisher nodes.
Subscriber Nodes: They subscribe to one or more data packages on the
bus and consume these data. For example, a motor driver may subscribe
to some speed command and drive the motor accordingly.
A node can both produce and consume data, acting as a publisher and a subscriber at the same time. For example, the main control unit in the car can read various sensor data from the bus, process them and publish command data for the actuator nodes (like motor drivers).
When using CAN Bus, instead of inventing your own protocol, it may be a better idea to use an existing protocol, like CANopen. I suggest you to read CiA 301 document which explains the fundamentals of CANopen. Even if you don't use it, it will give you some ideas.
I am starting to look into home environment and appliance control via the Internet.
I have an infotainment background that includes audio transport in distributed infotainment systems via MOST and Ethernet. For the latter I have experience with IEEE1722 (IEEE 1722 - LAYER 2 TRANSPORT PROTOCOL WORKING GROUP FOR TIME-SENSITVE STREAMS).
As I looked into IoT and the home domain (I use that term loosely to include appliances, security, environment, landscape maintenance) I had hoped to find a standard command and control protocol, for example something analogous to IEEE1722.1, but applicable to command and control in the home domain.
I did some searching and I see there are a number of packaged solutions (i.e. products and software recommendations) available. There are also a number of kits out there (e.g. RPI3 and Beaglebone Black, TINI) that would be useful platforms for a type of home controller however I found no mention of a standard protocol for command and control of the home apps. We have the lower layer protocols like IP, TCP, UDP, SSL, HTTP ... etc but as far as I could tell no standard application layer protocol.
Does such a protocol standard (either formal or de-facto) exist? If so could you please provide a pointer to it?
BTW there was a hit on my search in Stackoverflow:
"Is there any standard for Smart Home?" But from what I could tell that was someone asking for the answer to questions posed by their classroom lecturer. It had -1 votes. My questions is not that.
Thanks in advance.
Jim
I did further searching and found https://developer.apple.com/homekit/ and http://www.knx.org/media/docs/Flyers/KNX-Basics/KNX-Basics_en.pdf and https://www.electronichouse.com/smart-home/home-automation-protocols-what-technology-is-right-for-you/#comments Thanks
I (the company rather) have a protocol implementation which uses the CAN hardware (CAN Transceiver). The protocol itself is not a standard CAN protocol stack. Is it possible to use any of the off the shelf CAN-bus monitors for debugging and investigating the data in the bus? I intend to see the bytes being transmitted and more importantly the other information like cycle time, frequency, delay, jitter (if any) and so on. Ofcourse more information is good and in-case some of these above mentioned parameters are missing, its still acceptable. The main purpose of the project is to show that the proprietary implementation is better (performance, bandwidth, speed, etc) than standard CAN stack while still using the CAN hardware (transceivers).
I think most commercial available CAN analyzers can do what you need. Look if they offer an option for programability, in order to provide the possibility to make your own interpretation of the CAN frames.
Can-Wiki offers a list
http://www.emtas.de/en/produkte/can-interpreter
I want to convince some clients to use MapServer and OpenLayers. Please can anyone suggest attractive websites to show off the possiblities!
The clients will be impressed by:
A density map (otherwise known as a heat map, colour-shaded grid coverage, contour plot...).
The ability for the user to download the underlying data for the density map, restricted to the area being viewed, in some format such as netCDF.
Standard OpenLayers stuff. Zooming, panning, scale bar, overview map...
Different base layers. Could be WMS, Google, Bing...
Searching for a placename, map is panned to display the place.
Exposing the heatmap data for other people to use in mashups as WMS or WCS
MapServer.org is back up but demo.mapserver.org seems to be down right now :( But from memory their examples didn't have the "wow" factor. The OpenLayers examples demonstrate only one or two features per example - I want something to wow the clients by showing all the capabilities in one example.
PS If you have good examples that use some other open source tools, post them by all means. But just JavaScript please: customer says no rich client.
EDIT Come on StackOverflow, someone must have an example that uses a density map?? I'm even offering a bounty now...
Note this answer is no longer relevant. The open source maps have since been replaced with a commercial alternative by a different company
http://maps.seai.ie/wind/ - mapping onshore and offshore wind speeds and farms in Ireland
http://maps.seai.ie/geothermal/ - mapping geothermal temperatures in Ireland, and borehole data
uses WMS services (and TileCache) for all the layers, so can be accessed by other client GIS's (well once I've set up metadata etc..)
has a variety of different base maps to choose from
built using MapFish / ExtJS
has drop down gazetteers for County and Townland (an Irish administrative unit)
all the basic map navigation tools and a simple info tool
right click on a layer to set transparency
uses MapServer opensource back-end, plus SQL Server 2008
The systems (and a third more complex Bioenergy Intranet system) got a mention here: http://www.geoconnexion.com/uploads/renewableenergy_intv9i4.pdf
http://haiticrisismap.org/ openlayes + geoxt
would it be possible to create a template map for the client with a bunch of data on it, census, socio, create some simple fake buffers.
Maybe have a look at the HeatMapAPI for Google Maps (not sure you'll wow the client with that though).
Another density map: http://maps.glassfish.org/server/ (showing the use of GlassFish around the world).
We're using the OpenLayers Heatmap layer, mostly because (for us) it handles large data volumes better than the Google Map version (your mileage may vary)
http://www.patrick-wied.at/static/heatmapjs/demo/maps_heatmap_layer/openlayers.php
By large data volumes, I mean location datasets with 100K+ rows
It also works nicely as an ASPX page with dynamic realtime data retrieval from an SQL Server database. I've used a stored procedure to pre-process the data into the array format, grouped by Latitude & Longitude.
For those that need a translation table to convert their UK Postcodes into Latitude & Longitude, here's a good source:
http://www.doogal.co.uk/UKPostcodes.php
The OneGeology Portal (http://portal.onegeology.org/OnegeologyGlobal/) has been online for about 10 years, currently running OpenLayers 2, with an OpenLayers 3 version in development.
The portal attempts to create a geological map of the world by pulling together disparate OGC services provided by data suppliers (mostly Geological Surveys) from across the globe. The portal provides access to data from WMS, WFS (simple and complex feature), and WCS. The portal uses CSW to help manage which functionality is available to a user, and provides the ability to style WMS layers through the application of custom SLD. Map contexts can be saved, shared and loaded using WMC.
There is a gazetteer to help you zoom to a location of choice, the ability to change projections, and scales, and the ability to create a KML file to allow the service to be used in Google Earth. Transparency can be changed on all layers.
There are currently 353 layers.
When the OneGeology project started, all documentation was geared to the support of services provided by MapServer, and many of the services in the portal are MapServer services. However, because the portal utilises open standards, any software that can provide services to those standards can be included.
This is an example of a classified grid generated in MapServer and displayed by OpenLayers: https://maps.greenwoodmap.com/sublette/mapserver/map#zcr=1/2690000/1170000/0&lyrs=slopesZ,townlim,ownership,roads. The raw, unclassified slope data can also queried by map click.