I am just reading the single register value of lora chip using python spidev by modified some bytes
Since the python spidev module correctly reads the register, we can conclude the Omega2 is able to communicate with your lora radio module and there is no show-stopping issue in spidev.
If the python spidev half-duplex transmission worked, and the C program doesn't work, I think it's safe to assume the C program is using full-duplex.
Again, my recommendations are:
- Look at the C code to see if there's a flag or switch for full duplex vs half duplex
- Consider using a software-based SPI bus to communicate with the lora module. More info in this FAQ post.
One more thing:
I am sharing code can you tell me whats wrong with it.
This is a very large ask for a community forum. In my experience, the best way to resolve and debug technical issues on a forum is through collaboration rather than throwing the whole problem at another user. Please keep that in mind