[Ovmsdev] OVMS v3 getting started

Mark Webb-Johnson mark at webb-johnson.net
Mon Sep 25 14:42:19 HKT 2017


Two known issues:

The Silicon Labs driver for OSX seems pretty flaky. Linux seems much better, and I haven’t tried Windows. On OSX, I had horrendous problems with the v5 drivers crashing my whole machine (Sierra 10.12). In the installation package, there is a “Legacy MacVCP Driver” directory containing the older 4.11.2 version - using that older version at least works without crashes, but has one known issue. If you ‘make monitor’ and are in the console to the board, then unplug the board, you get left with a /dev.tty.SLAB* device hanging around that messes up that one USB port and future ‘make monitor’ connections. Workaround is to power off the USB hub, and then everything cleans out nicely. If you are directly connected to your MAC’s USB port, then you seem to need to reboot the whole machine to fix the issue. Getting used to being careful to disconnect from the terminal before unplugging (or simply not unplugging - which was happening a lot when I was working on power optimisation, sleep modes, and external 12V power).

I’m having problems getting SD CARDs to work reliably. Some work recognise at all (a timeout error when mounting), and some will recognise but fail under heavy writes to the sd card. Frustrating as hell. I don’t think it is a hardware issue (even the googling that error message points to pull-up resistors as the culprit), but suspect some issue with the ESP IDF 2.1 library we are using. We’re working on this one at the moment. I would appreciate your feedback, when you get the boards, as to whether you get any success with SD CARDs.

Regards, Mark.

> On 22 Sep 2017, at 3:22 PM, Mark Webb-Johnson <mark at webb-johnson.net> wrote:
> 
> 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.
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.teslaclub.hk/pipermail/ovmsdev/attachments/20170925/788added/attachment.html>


More information about the OvmsDev mailing list