[Ovmsdev] OVMS v3 getting started

Mark Webb-Johnson mark at webb-johnson.net
Fri Sep 22 15:22:33 HKT 2017


For those of you about to receive OVMS v3 modules, and for others listening in, here is a ‘getting started’ guide.

Follow the instructions in the developer’s guide to download the ESP IDF, extensa tools, and OVMS firmware source tree.
Connect a powered USB hub to your PC, and then connect the OVMS v3 module to that hub, using a micro-usb cable. OVMS v3 is currently in prototype stage, and is not yet FCC/CE approved, so we don’t recommend directly connecting it to your PC’s USB ports.
Do a “make” and “make flash”.
Do a “make monitor” and enjoy the “Welcome” prompt and cursor awaiting your commands.

Developer’s documentation is here:

https://docs.google.com/document/d/1q5M9Lb5jzQhJzPMnkMKwy4Es5YK12ACQejX_NWEixr0/edit?usp=sharing <https://docs.google.com/document/d/1q5M9Lb5jzQhJzPMnkMKwy4Es5YK12ACQejX_NWEixr0/edit?usp=sharing>

You can check the Over-The-Air update system with:

OVMS > ota status
Firmware: 3.0.0/factory/main build (idf v2.1-2-g7138fb0) Sep 22 2017 13:33:43
Running partition: factory
Boot partition: factory

The adventurous can put an firmware image on SD card, push it into the OVMS slot, and then “ota flash vfs /sd/<imagename>”.

Now, let’s do some radio stuff and bring up a wifi connection:

OVMS > config set wifi.ssid <SSID> <PASSWORD>

(replace <SSID> with your wifi’s SSID, and <PASSWORD> with it’s password - no spaces supported at the moment)

OVMS > wifi mode client <SSID>
I (1446306) wifi: connected with STUBBY, channel 11
I (1448626) event: ip: 192.168.1.100, mask: 255.255.255.0, gw: 192.168.1.1
I (1448626) ovms-mdns: Launching MDNS service
I (1448626) obd2wifi: Launching telnet server

Cool. Now OVMS is a wifi client on your network. You can even “telnet 192.168.1.100” (or whatever address is shown) to remotely access it over wifi. If you want to be really fancy, try taking advantage of the Bonjour mDNS system and “telnet OVMS.local”.

If you don’t have a wifi network to connect to (seriously?), OVMS can be a wifi Access Point itself:

OVMS > config set wifi.ap <SSID> <PASSWORD>

(replace <SSID> with the SSID you choose, and <PASSWORD> with a password that clients will use to connect - no spaces supported at the moment)

OVMS > wifi mode ap <SSID>

Then connect to the OVMS module using your phone/PC, as required. Telnet is your friend.

Let’s try to configure some vehicle parameters, so we can connect to an OVMS v2 server:

OVMS > config set vehicle id <VEHICLEID>
OVMS > config set server.v2 server api.openvehicles.com <http://api.openvehicles.com/>
OVMS > config set server.v2 password <SERVERPASSWORD>

(The <VEHICLEID> and <SERVERPASSWORD> are whatever you registered with openvehicles.com <http://openvehicles.com/>).

OVMS > server v2 start
Launching OVMS Server V2 connection (oscv2)
I (1881896) ovms-server: Launching OVMS Server V2 connection task (oscv2)
I (1881936) ovms-server-v2: Connected to OVMS Server V2 at api.openvehicles.com <http://api.openvehicles.com/>
I (1881966) ovms-server-v2: OVMS V2 login successful, and crypto channel established
I (1881976) ovms-server-v2: Incoming Msg: MP-0 Z0

Note that this will have the side-effect of changing that mDNS advertisement to be <VEHICLEID>.local.

We can now see some metrics:

OVMS > metrics list
m.freeram                      46716
m.hardware                     OVMS WIFI BLE BT cores=2 rev=ESP32/1
m.serial                       aa:bb:cc:dd:ee:ff
m.tasks                        18
m.version                      3.0.0/factory/main build (idf v2.1-2-g7138fb0) Sep 22 2017 06:33:43
s.v2.connected                 yes
s.v2.peers                     0
v.b.12v                        0

Looks good. Try connecting an App to the server (on the same vehicle ID) and watch s.v2.peers go from 0 to 1.

Now, start up a vehicle module:

OVMS > vehicle module TR
I (2016816) v-teslaroadster: Tesla Roadster v1.x, v2.x and v3.0 Vehicle Module

Plug it into the car, and watch the other metrics arrive. Power it from the vehicle’s 12V, and watch v.b.12v show your voltage.

Don’t forget that we’ve got a modem as well:

OVMS > power simcom on
Power mode of simcom is now on

OVMS > simcom tx AT

So, how do we make this work automatically at startup? We’ve still got a lot of work to do on this, but one way at the moment is to take a SD card and format it as FAT32. Then, create  directories:

/events
/events/system.start
/events/system.wifi.sta.gotip

Create two scripts:

/events/system.start/myscript
wifi mode client <SSID>
vehicle module TR

/events/system.wifi.sta.gotip
server v2 start

Unmount the SD from your computer, and put it in the OVMS module. On boot, you’ll see it mounted under ESP-32’s vfs as /sd. You’ll also see your scripts run (the first at boot, and the second once the wifi comes up). The scripting system will automatically run all scripts it can find in the /store/events/<eventname> and /sd/events/<eventname> directories.

There’s a lot more there, and it is early days, but that should give you a start and a better idea how this is coming together.

Regards, Mark.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20170922/4597588d/attachment.htm>


More information about the OvmsDev mailing list