Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variant of sx1268 with t-echo added #1654

Closed
wants to merge 2 commits into from
Closed

Variant of sx1268 with t-echo added #1654

wants to merge 2 commits into from

Conversation

lewisxhe
Copy link
Contributor

LilyGo techo plans to launch the 433 version of the sx1268 variant, I added the sx1268 option according to the project situation, other hardware remains unchanged, only changed the 433 version to SX1268

@CLAassistant
Copy link

CLAassistant commented Aug 26, 2022

CLA assistant check
All committers have signed the CLA.

@sachaw
Copy link
Member

sachaw commented Aug 26, 2022

Does this actually require a board variant. What's preventing it from working with the existing definition?

@caveman99
Copy link
Member

The code is written in a way you can define both chips and have it use the once present. see https://github.com/meshtastic/Meshtastic-device/blob/fd27a40edb941366a212204731c062a7ac90d48a/src/main.cpp#L352-L376 - there may be the need to add additional runtime flags, cause these macros are used in a few other places. Definitely no need for a separate variant though.

@lewisxhe
Copy link
Contributor Author

Yes, creating a new variant is not the best choice, maybe it should be determined at runtime which module it is

@lewisxhe lewisxhe closed this Aug 26, 2022
@caveman99
Copy link
Member

@lewisxhe it's pretty much the same on the T-Beam Firmware, it auto detects the radio too. I can assist in a new pull requests to add this as an unified firmware, if required :-)

@lewisxhe
Copy link
Contributor Author

There is no search for the radio model in the code. Using the SX1268 in the actual test will display Critical fault #3 on the screen. The following is the complete startup log


//\ E S H T /\ S T / C      

??:??:?? 1 Filesystem files:
??:??:?? 1   db.proto (141 Bytes)
??:??:?? 1   config.proto (40 Bytes)
??:??:?? 1   module.proto (16 Bytes)
??:??:?? 1   channels.proto (53 Bytes)
??:??:?? 1 I2C device found at address 0x51
??:??:?? 1 PCF8563 RTC found
??:??:?? 1 I2C device found at address 0x77
??:??:?? 1 Wire.available() = 1
??:??:?? 1 BME-280 sensor found at address 0x77
??:??:?? 1 2 I2C devices found
??:??:?? 1 Meshtastic hwvendor=7, swver=1.3.40.86c0ea8c-d
??:??:?? 1 Reset reason: 0x1
??:??:?? 2 Setting random seed 1163484515
??:??:?? 2 Initializing NodeDB
??:??:?? 2 Loading /prefs/db.proto
??:??:?? 2 Loaded saved devicestate version 15
??:??:?? 2 Loading /prefs/config.proto
??:??:?? 2 Loaded saved config version 15
??:??:?? 2 Loading /prefs/module.proto
??:??:?? 2 Loaded saved moduleConfig version 15
??:??:?? 2 Loading /prefs/channels.proto
??:??:?? 2 Loaded saved channelFile version 15
??:??:?? 2 Expanding short PSK #1
??:??:?? 2 Wanted region 0, using Unset
??:??:?? 2 region=0, NODENUM=0xc1f901ad, dbsize=1
??:??:?? 3 Saving /prefs/db.proto
??:??:?? 4 Saving /prefs/config.proto
??:??:?? 5 Saving /prefs/module.proto
??:??:?? 7 Saving /prefs/channels.proto
??:??:?? 8 Using analog input 4 for battery level
??:??:?? 8 Read RTC time from PCF8563 as 1490967117
13:31:57 8 Using MSL altitude model
13:31:57 8 WANT GPS=1
13:31:59 10 GxGSA NOT available
13:31:59 10 No /prefs/oem.proto preferences found
13:31:59 10 Doing EInk init
13:31:59 11 Turning on screen
13:32:02 13 Updating E-Paper... done
13:32:13 24 Module wants a UI Frame
13:32:13 24 Starting meshradio init...
13:32:13 24 Set radio: region=Unset, name=LongF, config=0, ch=91, power=30
13:32:13 24 Radio myRegion->freqStart / myRegion->freqEnd: 902.000000 -> 928.000000 (26.000000 mhz)
13:32:13 24 Radio myRegion->numChannels: 104
13:32:13 24 Radio channel_num: 91
13:32:13 24 Radio frequency: 924.875000
13:32:13 24 Slot time: 42 msec
13:32:13 24 Set radio: final power level=22
13:32:13 24 SX126x init result -707
13:32:13 24 Frequency set to 924.875000
13:32:13 24 Bandwidth set to 250.000000
13:32:13 25 Power output set to 22
13:32:13 25 Current limit set to 140.000000
13:32:13 25 Current limit set result -706
13:32:13 25 Warning: Failed to find SX1262 radio
13:32:13 25 NOTE! Recording critical error 3 at src\main.cpp:1a8
13:32:13 25 PowerFSM init, USB power=1
13:32:13 25 Enter state: BOOT
13:32:13 25 [Power] Battery: usbPower=1, isCharging=1, batMv=4671, batPct=100
13:32:13 25 [Screen] Screen: Started...
13:32:13 25 [Screen] Screen: Critical error 3!
13:32:16 28 [Screen] Updating E-Paper... done
13:32:24 36 [GPS] publishing pos@0:2, hasVal=0, GPSlock=0
13:32:24 36 [GPS] No GPS lock
13:32:24 36 [GPS] onGPSChanged() pos@0, time=0, lat=0, lon=0, alt=0
13:32:24 36 [GPS] updatePosition LOCAL pos@0, time=0, latI=0, lonI=0, alt=0
13:32:24 36 [GPS] Node status update: 0 online, 1 total
13:32:24 36 [DeviceTelemetryModule] Device Telemetry: Initializing
13:32:24 36 [DeviceTelemetryModule] -----------------------------------------
13:32:24 36 [DeviceTelemetryModule] Device Telemetry: Read data
13:32:24 36 [DeviceTelemetryModule] Telemetry->time: 1490967144
13:32:24 36 [DeviceTelemetryModule] Telemetry->air_util_tx: 0.000000
13:32:25 36 [DeviceTelemetryModule] Telemetry->battery_level: 100
13:32:25 36 [DeviceTelemetryModule] Telemetry->channel_utilization: 0.000000
13:32:25 36 [DeviceTelemetryModule] Telemetry->voltage: 4.671000
13:32:25 36 [DeviceTelemetryModule] Initial packet id 113888663, numPacketId 4294967295
13:32:25 36 [DeviceTelemetryModule] Device Telemetry: Sending packet to mesh
13:32:25 36 [DeviceTelemetryModule] Update DB node 0xc1f901ad, rx_time=0
13:32:25 36 [DeviceTelemetryModule] Error=4, returning NAK and dropping packet.
13:32:25 36 [DeviceTelemetryModule] Alloc an err=4,to=0xc1f901ad,idFrom=0x6c9cd99,id=0x6c9cd9a
13:32:25 36 [DeviceTelemetryModule] Enqueued local (id=0x06c9cd9a Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd99 priority=120)
13:32:25 36 [DeviceTelemetryModule] updateTelemetry LOCAL
13:32:25 36 [DeviceTelemetryModule] Node status update: 0 online, 1 total
13:32:25 37 [PowerFSM] Enter state: POWER
13:32:25 37 [PowerFSM] Initialize the Bluefruit nRF52 module
13:32:26 37 [PowerFSM] Bluetooth pin set to '911503'
13:32:26 37 [PowerFSM] Configuring the Device Information Service
13:32:26 37 [PowerFSM] Configuring the Battery Service
13:32:26 37 [PowerFSM] Configuring the Mesh bluetooth service
13:32:26 37 [PowerFSM] Setting up the advertising payload(s)
13:32:26 38 [PowerFSM] Advertising
13:32:26 38 [Router] Rx someone rebroadcasting for us (id=0x06c9cd9a Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd99 priority=120)
13:32:26 38 [Router] didn't find pending packet
13:32:26 38 [Router] Add packet record (id=0x06c9cd9a Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd99 priority=120)
13:32:26 38 [Router] handleReceived(REMOTE) (id=0x06c9cd9a Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd99 priority=120)
13:32:26 38 [Router] Module 'routing' wantsPacket=1
13:32:26 38 [Router] Received routing from=0xc1f901ad, id=0x6c9cd9a, portnum=5, payloadlen=2
13:32:26 38 [Router] Routing sniffing (id=0x06c9cd9a Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd99 priority=120)
13:32:26 38 [Router] Received a nak for 0x6c9cd99, stopping retransmissions
13:32:26 38 [Router] FIXME-update-db Sniffing packet
13:32:27 38 [Router] Delivering rx packet (id=0x06c9cd9a Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd99 priority=120)
13:32:27 38 [Router] Forwarding to phone (id=0x06c9cd9a Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd99 priority=120)
13:32:27 38 [Router] Update DB node 0xc1f901ad, rx_time=0
13:32:27 38 [Router] Module 'routing' considered
13:32:27 38 [Screen] Done with boot screen...
13:32:27 38 [Screen] Screen: Powered...
13:32:27 38 [Screen] showing standard frames
13:32:27 38 [Screen] Showing 0 module frames
13:32:27 38 [Screen] Total frame count: 83
13:32:27 38 [Screen] Added modules.  numframes: 0
13:32:27 39 [Screen] Finished building frames. numframes: 3
13:32:27 39 [Screen] Setting fast framerate
13:32:27 39 [Screen] Setting idle framerate
13:32:31 43 [Screen] Updating E-Paper... done
13:32:41 53 [Power] Battery: usbPower=1, isCharging=1, batMv=4668, batPct=100
13:32:41 53 [NodeInfoModule] Sending our nodeinfo to mesh (wantReplies=1)
13:32:41 53 [NodeInfoModule] sending owner !c1f901ad/Meshtastic 01ad/01ad
13:32:41 53 [NodeInfoModule] Update DB node 0xc1f901ad, rx_time=0
13:32:41 53 [NodeInfoModule] Error=4, returning NAK and dropping packet.
13:32:41 53 [NodeInfoModule] Alloc an err=4,to=0xc1f901ad,idFrom=0x6c9cd9b,id=0x6c9cd9c
13:32:41 53 [NodeInfoModule] Enqueued local (id=0x06c9cd9c Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd9b priority=120)
13:32:41 53 [Router] Rx someone rebroadcasting for us (id=0x06c9cd9c Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd9b priority=120)
13:32:41 53 [Router] didn't find pending packet
13:32:41 53 [Router] Add packet record (id=0x06c9cd9c Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd9b priority=120)
13:32:42 53 [Router] handleReceived(REMOTE) (id=0x06c9cd9c Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd9b priority=120)
13:32:42 53 [Router] Module 'routing' wantsPacket=1
13:32:42 53 [Router] Received routing from=0xc1f901ad, id=0x6c9cd9c, portnum=5, payloadlen=2
13:32:42 53 [Router] Routing sniffing (id=0x06c9cd9c Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd9b priority=120)
13:32:42 53 [Router] Received a nak for 0x6c9cd9b, stopping retransmissions
13:32:42 53 [Router] FIXME-update-db Sniffing packet
13:32:42 53 [Router] Delivering rx packet (id=0x06c9cd9c Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd9b priority=120)
13:32:42 54 [Router] Forwarding to phone (id=0x06c9cd9c Fr0xad To0xad, WantAck0, HopLim0 Ch0x0 Portnum=5 requestId=6c9cd9b priority=120)
13:32:42 54 [Router] Update DB node 0xc1f901ad, rx_time=0
13:32:42 54 [Router] Module 'routing' considered
13:32:43 55 [GPS] NMEA GPS time 2022-08-26 08:08:29
13:32:44 55 [GPS] Upgrading time to RTC 1661501309 secs (quality 0)
08:08:29 55 [GPS] PCF8563_RTC setDateTime 2022-08-26 08:08:29 1661501309
08:08:29 55 [GPS] Read RTC time from PCF8563 as 1490967165
13:32:45 55 [GPS] publishing pos@0:2, hasVal=0, GPSlock=0
13:32:45 55 [GPS] onGPSChanged() pos@0, time=1490967165, lat=0, lon=0, alt=0
13:32:45 55 [GPS] updatePosition LOCAL pos@0, time=1490967165, latI=0, lonI=0, alt=0
13:32:45 55 [GPS] Node status update: 1 online, 1 total
13:33:02 73 [Power] Battery: usbPower=1, isCharging=1, batMv=4677, batPct=100
13:33:22 93 [Power] Battery: usbPower=1, isCharging=1, batMv=4687, batPct=100

image

@caveman99

@lewisxhe
Copy link
Contributor Author

If possible, add auto-find radio model to match different variants [1262/1268]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants