Open fphammerle opened 3 years ago
Same transceiver, now connected to raspberry pi 2B:
$ pip3 show cc1101 | grep ^Version
Version: 2.7.0
$ ~/.local/bin/cc1101-export-config >/dev/null
CC1101(marcstate=idle, base_frequency=800.00MHz, symbol_rate=115.05kBaud, modulation_format=ASK_OOK, sync_mode=TRANSMIT_16_MATCH_16_BITS, preamble_length=4B, sync_word=0xd391, packet_length≤255B, output_power=(0xc6,0))
Maybe max_speed_hz
is too high, currently 55700 Hz:
https://github.com/fphammerle/python-cc1101/blob/v2.6.1/cc1101/__init__.py#L524
max_speed_hz = n
with n <= 47100
triggers
Traceback (most recent call last):
File "cc1101_test.py", line 2, in <module>
with cc1101.CC1101(spi_bus=0, spi_chip_select=1) as t:
File "/usr/lib/python3.6/site-packages/cc1101/__init__.py", line 524, in __enter__
self._spi.max_speed_hz = 47100 # empirical
OSError: [Errno 22] Invalid argument
static int
SpiDev_set_max_speed_hz(SpiDevObject *self, PyObject *val, void *closure)
{
// ...
if (self->max_speed_hz != max_speed_hz) {
if (ioctl(self->fd, SPI_IOC_WR_MAX_SPEED_HZ, &max_speed_hz) == -1) {
PyErr_SetFromErrno(PyExc_IOError);
return -1;
}
self->max_speed_hz = max_speed_hz;
}
return 0;
}
board: https://onion.io/store/omega2p/
wiring: https://docs.onion.io/omega2-docs/communicating-with-spi-devices.html