2017-05-18 06:35 AM
Hi,
I have one question about the SPWF04S module python capabilities. Looking at the 'console_active' configuration variable, it seems that the python functionalities can be used only with the UART. Given that the command 'AT+S.PYTHON' has its SPI equivalent though, i would say that scripts can be launched via SPI, and the only thing that needs an UART to function is the REPL; is this correct?
Thank you
#spwf04sa2017-05-18 06:52 AM
Ciao Matteo,
console_enabled (not console_active ) can be set from 0 to 3:
0 and 1 -> interface is SPI or UART only. You cannot run AT+S.PYTHON, since REPL mode is intended only for UART;
2 -> this is the UART+REPL mode. You can enter REPL (AT+S.PYTHON), or run a script (AT+S.PYTHON=script.py);
3 -> interfaces are disabled over UART/SPI pins
Once inside the python REPL, or while executing a python script, we can use different and dedicated UART/SPI peripherals, over GPIOs alternate functions. Moreover, you can find I2C, ADC, DAC & PWM classes.
Summary:
Python is only available when
console_
enabled
>=2REPL is only available when
console_
enabled
==2SPWF04S pins for communication interface (UART or SPI) are not GPIOs
Python peripherals (UART and SPI and others) are GPIOs (0 to 18)
2017-05-19 01:56 AM
Ciao Gerardo,
Thank you again. Do you know if there are any plans (even if not short-term) to implement python via SPI or the bus is just not fit for this application?
2017-05-19 02:54 AM
Ciao Matteo,
if with 'python via SPI' you mean 'REPL over SPI', no, there are no plans for some reasons:
In a few works: there is no console_enabled meaning SPI+REPL mode