Coral Dev Board Mini i2C connect to Adafruit Motor Shield V2 - i2c

Anyone have any success connecting the Coral Dev Board Mini to Adafruit's Motor Shield V2 (AMS) with I2C?
My first solution was to use the only 3 PWM on the Dev Mini to control the speed and direction of a motor, but i need two motors.
So decided to go the I2C route coupled with Adafruit's Motor Shield V2.
I've connected the following pins between the board and shield
Mini 5V -> AMS Vin
Mini GND -> AMS GND
Mini SDA (pin 3) -> AMS SDA pin
Mini SCL (pin 5) -> AMS SCL pin
On the mini the SDA/SCL pins 3 & 5 are associated with device path /dev/i2c-3
sudo i2cdetect -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
and I should be seeing 0x60.
The default Mini pin states are
HIGH (4.7K pull-up)
Any ideas?
Or Any thoughts on another solution to control the speed and direction of two motors?

I don't know the Adadfruit motor driver, but if you connect +5V to it's Vin it might well pull up the I2C lines to this voltage which might not be compatible with the 3.3V the mini dev uses. Have you checked this?
I have tried something similar, but with the SparkFun Auto pHAT (which does 3.3V <-> 5V conversion on the I2C bus). I could not get I2C working between the Auto pHat and the dev board mini. Maybe something in the I2C implementation of the mini is not working out of the box. I could control the Auto pHat with a (3.3V) ESP32 without problems.
I have also developed my own motor driver which is controlled by I2C and the prototype works well with the ESP32, I have not yet tried it with the the dev board mini. I'll give it a try and let you know.

Related

Raspberry Pi 4 I2C bus was working, but fails after reboot

I have an SSD1306 OLED display and RPi4. I used the tutorial from https://maker.pro/raspberry-pi/projects/raspberry-pi-monitoring-system-via-oled-display-module which (after a small mod) was working up until I updated /etc/rc.local and did a reboot.
Since then, I get nothing.
sudo i2cdetect -y 1 now gives me:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I had created an image of the SD Card before setting up the OLED, and restoring the image and trying again I still can't detect the OLED.
I'd appreciate any tips or thoughts on resolving this.
Solution is unknown. I left the Pi run for a while, then tried again and it just worked.

Raspberry PI 4 + Huawei E3372 - Send AT commands

I'm trying to send AT commands to a Huawei E3372 USB Dongle but I haven't figured out how to mount correctly.
If I do lsusb, I get the following:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0
Bus 001 Device 003: ID 03f0:034a HP, Inc Elite Keyboard
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
The dongle is listed, I can also access it's configuration screen on 192.168.1.1 and I can access internet.
I have tried creating the config file:
sudo nano /etc/usb_modeswitch.d/12d1:14db
and entered the following configuration
TargetVendor=0x12d1
TargetProduct=0x14db
MessageContent="55534243123456780000000000000011062000000100000000000000000000"
NoDriverLoading=1
I have tried various configurations found on the web but none seems to work.
/dev/tty /dev/tty19 /dev/tty3 /dev/tty40 /dev/tty51 /dev/tty62
/dev/tty0 /dev/tty2 /dev/tty30 /dev/tty41 /dev/tty52 /dev/tty63
/dev/tty1 /dev/tty20 /dev/tty31 /dev/tty42 /dev/tty53 /dev/tty7
/dev/tty10 /dev/tty21 /dev/tty32 /dev/tty43 /dev/tty54 /dev/tty8
/dev/tty11 /dev/tty22 /dev/tty33 /dev/tty44 /dev/tty55 /dev/tty9
/dev/tty12 /dev/tty23 /dev/tty34 /dev/tty45 /dev/tty56 /dev/ttyAMA0
/dev/tty13 /dev/tty24 /dev/tty35 /dev/tty46 /dev/tty57 /dev/ttyprintk
/dev/tty14 /dev/tty25 /dev/tty36 /dev/tty47 /dev/tty58
/dev/tty15 /dev/tty26 /dev/tty37 /dev/tty48 /dev/tty59
/dev/tty16 /dev/tty27 /dev/tty38 /dev/tty49 /dev/tty6
/dev/tty17 /dev/tty28 /dev/tty39 /dev/tty5 /dev/tty60
/dev/tty18 /dev/tty29 /dev/tty4 /dev/tty50 /dev/tty61
No more luck with dmesg | grep ttyUSB that returns nothing (same for USB0, USB1,...)
It's probably something wrong in the config file but I don't see exactly what needs to be done.
Any idea ?
Thanks!
You attach wrong lsusb output. The dongle is not listed.
Perhaps the device code 14db and accessible 192.168.1.1 looks like your modem is switched to newest mode where the dongle looks like router. If you would like to send AT command then you must change mode to serial. First of all try it through:
/etc/usb_modeswitch.conf
The last part of the file contain your desired option:
HuaweiAltModeGlobal=0
Notice the comment above this option:
...you can globally set an alternative method here which provides a
different mode: either plain serial PPP...
Just try to change number. There should be around 6 modes and one of them will switch your dongle to serial mode.
Best luck.

getting time out error while connecting postgres in sails application in development mode?

I am trying to develop a simple HTTP API using sails framework. I have created models, controllers, helpers and routes in order to complete the workflow of the API but when I am lifting sails app in development mode , I am getting a timeout error for setting migrate=alter. After debugging on my own I got to the conclusion that my sails app is not connecting with the postgres.
I have installed all the related dependencies (ex. sails-postgresql, pg etc..), I am setting a correct URL in config.model file. I don't know what I am missing with this..
Any suggestions???
versions: sails-1.2.4, postgresql-12.4
edit: This is the error I am getting.
nirajrajput#Nirajs-MacBook-Pro demosails % node app.js
(node:29522) Warning: Accessing non-existent property 'padLevels' of
module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was
created)
info: ·• Auto-migrating... (alter)
info: Hold tight, this could take a moment.
error: Failed to lift app: Error: Sails is taking too long to load.
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- --
Troubleshooting tips:
-• Were you still reading/responding to an interactive prompt?
(Whoops, sorry! Please lift again and try to respond a bit more
quickly.)
-• Do you have a lot of stuff in `assets/`? Grunt might still be
running.
(Try increasing the hook timeout. Currently it is 40000.
e.g. `sails lift --hookTimeout=80000`)
-• Is `blueprints` a custom or 3rd party hook?
(*If* `initialize()` is using a callback, make sure it's being
called.)
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- --
at Timeout.tooLong [as _onTimeout] (/Users/nirajrajput/demosails/node_modules/sails/lib/app/private/loadHooks.js:191:21)
at listOnTimeout (internal/timers.js:551:17)
at processTimers (internal/timers.js:494:7)

How to see where in the queue I am for a job on a cluster?

I am using a cluster computer to compute a "lmem" job. I submitted my job a day ago and while normally the job immediately begins running and I can monitor how long it has been running with qstat, this job remains in the queue.
I used qstat -q to see that
`Queue Memory CPU Time Walltime Node Run Que Lm State
---------------- ------ -------- -------- ---- --- --- -- -----
lmem -- -- -- -- 36 235 -- E R
batch -- -- -- -- 8 0 -- E R
express 4gb -- 06:00:00 -- 17 0 -- E R
test -- -- -- -- 0 0 -- D S
production 16gb -- -- -- 66 157 -- E R
route -- -- -- -- 0 0 -- E R`
Someone must have put in A LOT of lmem jobs. I was wondering if there was a way to see where on that list of 235 my job is in line?
When using a scheduler like Moab or Maui, you can run a commands such as checkjob -v and mdiag -p (or have an admin do it for you) to see if the job has an advance/priority/job reservation, and how many jobs it has in front of it. The default ordering of showq will place jobs with a job reservation at or near the top of the Eligible/Idle list. If you're only using pbs_sched, then the order shown in a plain qstat is the order in which it will run, although that may not make it clear how soon it can run.

how to record an ir signal from an AC remote using LIRC in raspberry pi?

i had already used the LIRC of the raspberry pi to record and use the IR signals of a samsung TV remote. the recording process was fine. i used this site for reference.But now i am unable to record the IR signals from a bluestar AC in the same method. After 1-3 dots (not always the same number), irrecord exits with the following error message:
irrecord: could not find gap.
irrecord: gap not found, can't continue
then i tried recording the AC remote signals using mode2 and routing it to a text file and manually modified the lircd.conf file to include the raw code as shown in the link
How to use irrecord with 2ms timing instead of the default 5ms?
but then i get the error that
irsend: command failed: SEND_ONCE /etc/lirc/lircd.conf KEY_POWER
irsend: unknown remote : "/etc/lirc/lircd.conf"
Possibly lircd doesn't accept all characters (e.g. slash) for the remote name. Try changing the:
name /etc/lirc/lircd.conf
in the .conf file to a different name (e.g. MY_REMOTE), then invoke the irsend like:
irsend SEND_ONCE MY_REMOTE KEY_POWER
The air conditioning controls send more bits than the television ones for example. You have to configure the lirc.conf header as:
begin remote
name IRAIR1
bits 48 #Configuración para 48 bits
flags SPACE_ENC
eps 30
aeps 100
header 3388 1678
one 430 1257
zero 430 412
ptrail 428
gap 108399
begin raw_codes
name KEY_POWER
3478 1676 500 1218 501 388
472 ..................................
end raw_codes
end remote
I think exactly what 48 bits are sending. This guy explains it: http://absurdlycertain.blogspot.com.es/2013/03/lirc-raspi-remote-control-configuration.html
Do not forget to restart the device, with me it does not work if I do not.
Sorry for my English