we are following a topic for running the wifi talon exp board on a FX30 (wp77xx) R15 (legato21) and are having issues with the configuration.
This is the log from the device, where it seems there is an error with the i2c communication:
Nov 14 16:23:04 fx30 user.debug Legato: DBUG | wifiService[1437]/daemon T=main | pa_wifi_ap.c GenerateHostapdConf() 401 | LE_WIFIAP_SECURITY_WPA2
Nov 14 16:23:04 fx30 user.info Legato: INFO | wifiService[1437] | WIFI_START
Nov 14 16:23:05 fx30 user.debug Legato: DBUG | wifiService[1437]/daemon T=main | pa_wifi_ap.c pa_wifiAp_Start() 665 | WiFi hardware started correctly
Nov 14 16:23:05 fx30 user.debug Legato: DBUG | wifiService[1437]/framework T=main | thread.c SetSchedPolicyAttr() 682 | Set scheduling policy to SCHED_OTHER for thread ‘WifiApPaThread’.
Nov 14 16:23:05 fx30 user.debug Legato: DBUG | wifiService[1437]/framework T=WifiApPaThread | thread.c PThreadStartRoutine() 478 | Set nice level to 0.
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437]/daemon T=WifiApPaThread | pa_wifi_ap.c WifiApPaThreadMain() 278 | Wifi event report thread started!
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437] | WIFIAP_HOSTAPD_START
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437]/daemon T=WifiApPaThread | pa_wifi_ap.c WifiApPaThreadMain() 295 | PARSING:WIFI_SET_EVENT : len:15
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | /legato/systems/current/apps/wifiService/read-only/pa_wifi:
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | line 427:
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | /bin/hostapd: not found
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] |
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437]/daemon T=WifiApPaThread | pa_wifi_ap.c WifiApPaThreadMain() 295 | PARSING: (phy #0): unknown event 8 (del_interface) : len:43
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437]/daemon T=WifiApPaThread | pa_wifi_ap.c WifiApPaThreadMain() 295 | PARSING:phy #0: delete wiphy : len:21
Nov 14 16:23:05 fx30 user.info Legato: INFO | wifiService[1437] | mangOH red board
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | sh: write error: Operation not permitted
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR* failed to read i2c data
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR* I2c get addr 0x3e value failure
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR* Set mode 0 failure
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR* failed to read i2c data
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR* I2c get addr 0x3e value failure
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR* Set polarity 0 failure
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR* failed to read i2c data
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR* I2c get addr 0x3e value failure
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437] | ERR* Set output 1 failure
Nov 14 16:23:05 fx30 user.err Legato: =ERR= | wifiService[1437]/daemon T=main | pa_wifi_ap.c pa_wifiAp_Start() 696 | WiFi Client Command “WIFIAP_HOSTAPD_START” Failed: (32512)
But on the hardware we have setup the UART to be assigned to the LINUX and then activated the GPIO8:
AT!MAPUART=17,2
AT+WIOCFG=8,16,1,0
The only extra thing we have noticed is that some of the module are missing now and we are not sure if this board should be run in a different way.
Any help will be very much appreciated!!!
Yup, so it seems that the second interface is mapped to the linux:
AT!MAPUART?
!MAPUART: 1,17
The new pa_wifi script should run the tiwifi setup script part below:
ti_wifi_start() {
lsmod | grep wlcore >/dev/null
if [ $? -ne 0 ]; then
# This is only required for WP85, because kernel is different.
if [ "${KVERSION}" = "314" ] ; then
# Check if MMC/SDIO module is inserted. Because WIFI use SDIO/MMC bus
# we need to remove the SDIO/MMC module
lsmod | grep msm_sdcc >/dev/null
if [ $? -eq 0 ]; then
grep -q mmcblk /proc/mounts
if [ $? -ne 0 ]; then
rmmod msm_sdcc
else
false
fi
if [ $? -ne 0 ]; then
# Unable to remove. May be others devices use SDIO/MMC bus
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "Unable to remove the SDIO/MMC module... May be in use ?"
echo "Please, free all SDIO/MMC devices before using TI WIFI."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 127
fi
fi
fi
# Enable all GPIOs on all EXPANDERs
gpioexp 1 1 enable >/dev/null || exit 127
### mangOH green has 3 expanders
# Set IOTO_RESET, GPIO#4/EXPANDER#3 - IOT0 Reset signal is disabled
gpioexp 3 4 output normal high >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "mangOH red board"
# Set IOT0_GPIO2 = 1 (WP GPIO13)
[ -d ${GPIO_DIR}13 ] || echo 13 >${GPIO_EXPORT}
echo out >${GPIO_DIR}13/direction
echo 1 >${GPIO_DIR}13/value
# Set IOT0_RESET = 1 (WP GPIO2)
[ -d ${GPIO_DIR}2 ] || echo 2 >${GPIO_EXPORT}
echo out >${GPIO_DIR}2/direction
echo 1 >${GPIO_DIR}2/value
# Clear SDIO_SEL, GPIO#9/EXPANDER#1 - Select the SDIO
gpioexp 1 9 output normal low >/dev/null || exit 127
else
echo "mangOH green board"
# Set IOT0_GPIO2 = 1 (WP GPIO33)
[ -d ${GPIO_DIR}33 ] || echo 33 >${GPIO_EXPORT}
echo out >${GPIO_DIR}33/direction
echo 1 >${GPIO_DIR}33/value
# Clear SDIO_SEL, GPIO#13/EXPANDER#1 - Select the SDIO
gpioexp 1 13 output normal low >/dev/null || exit 127
fi
# Kernel 3.14 only.
if [ "${KVERSION}" = "314" ] ; then
modprobe msm_sdcc || exit 127
fi
modprobe wlcore || exit 127
modprobe wlcore_sdio || exit 127
modprobe wl18xx || exit 127
fi
attempt=6
for i in $(seq 1 ${attempt})
do
if [ $i -ne 1 ]; then
sleep 1
fi
(ifconfig -a | grep wlan0 > /dev/null) && break
done
if [ $? -ne 0 ]; then
echo "Failed to start TI wifi, interface does not exist."
exit ${TI_WIFI_PA_NO_IF_ERR}
fi
ifconfig wlan0 up > /dev/null
if [ $? -ne 0 ] ; then
echo "Failed to start TI wifi, interface can not be brought up."
exit ${TI_WIFI_PA_NO_IF_UP_ERR}
fi
}
but even when I try to run the command manually it seems that the error with the i2c communication still persist…
wifiService[1438] | WIFI_START
wifiService[1438] | ERR* failed to write i2c data wifiService[1438] | FTL Failed to enable PCA9548A I2C switch* wifiService[1438] | Clean up due to unknown error
As it fails for i2c communication, while on the previous legato version it seemed this was using the UART2 communication, I am wondering if we have to change the way the communication with the IoT exp board works?
Understand this is not something fully supported by SWI, possibly someone experienced with the talon IoT wifi could reply? We are looking at implementing this on several devices and would like to have an understanding of why this is no longer working with the new legato version…
thank you for that, you were correct, this is what happens:
root@fx30:~# gpioexp 1 1 enable
expander#:1 gpio pin:1, i2cAddr:0x3e
module 1, pin 1 i2cAddr 62 bus 4 bank 1
Open I2C Bus at, ‘/dev/i2c/4’
Try open I2C Bus at, ‘/dev/i2c-4’
Enabling PCA9548A I2C switch…
Open I2C Bus at, ‘/dev/i2c/4’
Try open I2C Bus at, ‘/dev/i2c-4’
ERR* failed to write i2c data
FTL* Failed to enable PCA9548A I2C switch
What is the meaning of this? We didn`t have this problem with the previous version of legato (19).
I can try to, do you have any reference and documentation about this gpioexp command?
We can try to rebuild from linux source to see if this solves the problem…
yup, it actually worked.
Will have a look to see if this can be handled from the legato part itself but I think we will need to re-build the linux image to solve the problem…
in order to get it up an running on a new device I need to modify the linux image.
but have tested a bit more this and it actually doesn’t work…
even when we comment the exit error, it will get stuck on deploying the kernel modules.
It would be nice to hear from anyone using the same IoT exp board as I guess this will be the same issue for everybody, or anyone can advise any alternative IoT wifi board?
we don`t really care and the talon one seems completely without any sort of support