Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- Jmriusers
- Messages
Search
Locked
Re: Jmri printing issue
#operationspro
Thanks I went there but it won’t let me print just this page even though I select to print inly on this page. It will only print 16 pages, which includes all the train info for all trains listed. I just need the train list sheet.? What am I missing? Frank Kenny
Central Pacific Railway - CPRX
310-344-9145
Los Angeles area
Instagram:?
Facebook:?
Blog:?? ?(Updated occasionally)
|
Locked
Team track
#operationspro
Gentlemen,?
I wish to set up a team track. this track will have multiple industries.? my dilemma is, I wish to have each industry listed individually as far as set-out and pickups go. example,? team track is called Lakeville spur,? industry is Ryan's Rebar,? I would like the train Manifest to read something like flat 123, destination Lakeville spur, set-out Ryan's Rebar.? how is the best way to go about this? John? -- Sent from my gosh darn droid! Please excuse the fat finger mistakes... John |
Ethernet/Serial
Tom I'll give that new version of the sketch a go when I get back from work tonight. If it is okay, which I'm sure it will be, then is it possible to modify it for the PN532 readers? There is a slight problem with the existing PN532 sketch, but I was waiting to get the MFRC522 Ethernet/Serial sketch sorted first.? I can then try the two Ethernet Uno's with different readers as network connections into JMRI and see how that goes. Steve |
On Mon, May 1, 2023 at 03:26 AM, <stephenjohnson500@...> wrote:
Here was me thinking it might be an easier option! Lol!Steve, No, you are completely correct in your summation of how the board works. It IS 2 boards in 1, operating exactly as you described. We can certainly give it a go though! :-) Tom |
开云体育You should be able to. ?They’re DCC decoders so once set up, they should work on any DCC system. You just need to know the decoder’s address.Mick ________________________________ Mick Moignard m: +44 7774 652504 Skype: mickmoignard The week may start M,T but it always ends WTF. |
On Mon, May 1, 2023 at 12:28 AM, Thomas Seitz wrote:
On Sun, Apr 30, 2023 at 07:17 PM, <stephenjohnson500@...> wrote:Tom Here was me thinking it might be an easier option! Lol! Interesting article though. Apart from the hassle programming it, it basically looks like two units on one board. From what I can see, the Uno part can use the standard Serial tag reading sketch. The ESP would need it's own sketch to set WiFi Credentials and TX/RX. Then surely the Uno would just send/recieve data via the internal serial connection from the ESP? Or is that just an over simplistic view? Lol! Steve |
Locked
Re: New user to JMRI Ops Pro requesting assistance
#operationspro
Hi Pete, I've got the latest Mina Manifest and Build Report attached dated 4/30/23. I've been reading the Build Reports as you suggested and am beginning to understand however slowly how the program looks at every car and location in order to build a Train. As you can see, I'm still getting one car going from the Hanford Team Trk. to the Mina Interchange Trk. without going to Arnold Yard first. (NKP 18878 Boxcar 45' Brown Team Trk 2 Mina, PRE Interchange)
Thank You Pete, Mel train _Mina Turn_.txt
train _Mina Turn_.txt
train _Mina Turn_4-30-23-1.txt
train _Mina Turn_4-30-23-1.txt
|
MFRC522, Ethernet/Serial, Nano/Uno/Mega // Import Libraries
#include <SPI.h>? ? ? ? ? ?// SPI library for communicating with the MFRC522 reader
#include <MFRC522.h>? ? ? ?// MFRC522 library for reading RFID cards
#include <Ethernet.h>? ? ? // Ethernet library for the Ethernet shield
?
// Ethernet configuration
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 1, 177); // Replace with the desired IP address
unsigned int serverPort = 8888;? // Replace with the desired port number
?
EthernetServer server(serverPort);
?
// Define the SS (Slave Select) and RST (Reset) pins for each reader
#if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO)
const uint8_t ssPins[] = {5, 6, 7, A0, A1, A2};
const uint8_t rstPins[] = {4, 8, 9, A3, A4, A5};
const uint8_t readerAssignment[] = {1, 2, 3, 4, 5, 6}; // Assign reader numbers based on SS and RST pins
#elif defined(ARDUINO_AVR_MEGA2560)
const uint8_t ssPins[] = {5, 6, 7, 8, 9, A0, A1, A2};
const uint8_t rstPins[] = {22, 23, 24, 25, 26, 27, 28, 29};
const uint8_t readerAssignment[] = {1, 2, 3, 4, 5, 6, 7, 8}; // Assign reader numbers based on SS and RST pins
#endif
?
const int numReaders = sizeof(ssPins) / sizeof(ssPins[0]);
const char readerID[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'};
?
struct RFIDReader {
? char id;
? uint8_t ssPin;
? uint8_t rstPin;
? MFRC522 mfrc522;
? byte nuid[7];
?
? RFIDReader() : id(0), ssPin(0), rstPin(0), mfrc522(MFRC522(0, 0)) {}
};
?
RFIDReader readers[numReaders];
EthernetClient client;
bool isEthernetConnected = false;
?
void setup() {
? Serial.begin(9600);
? SPI.begin();
? pinMode(10, OUTPUT);
? digitalWrite(10, HIGH);
?
? // Set pin 53 as OUTPUT for the Arduino Mega 2560
? #if defined(ARDUINO_AVR_MEGA2560)
? ? pinMode(53, OUTPUT);
? #endif
?
? pinMode(4, OUTPUT);
? digitalWrite(4, HIGH);
?
? Ethernet.begin(mac, ip);
? delay(1000);
?
? if (Ethernet.hardwareStatus() == EthernetNoHardware || Ethernet.linkStatus() == LinkOFF) {
? ? Serial.println("Ethernet shield not connected or network not available");
? ? isEthernetConnected = false;
? } else {
? ? isEthernetConnected = true;
? }
?
? for (uint8_t i = 0; i < numReaders; i++) {
? ? readers[i].ssPin = ssPins[i];
? ? readers[i].rstPin = rstPins[i];
? ? readers[i].id = readerID[readerAssignment[i] - 1]; // Assign the reader ID based on readerAssignment array
? ? readers[i].mfrc522 = MFRC522(readers[i].ssPin, readers[i].rstPin);
? ? readers[i].mfrc522.PCD_Init();
? ? readers[i].mfrc522.PCD_SetAntennaGain(readers[i].mfrc522.RxGain_max);
?
? ? // Print debugging information
? ? Serial.print("Reader ");
? ? Serial.print(readers[i].id);
? ? Serial.print(" detected on SS pin ");
? ? Serial.println(readers[i].ssPin);
? }
?
? if (isEthernetConnected) {
? ? server.begin();
? }
?
? // Blink the LED to indicate the number of detected readers
? pinMode(LED_BUILTIN, OUTPUT);
? for (int i = 0; i < numReaders; i++) {
? ? digitalWrite(LED_BUILTIN, HIGH);
? ? delay(300);
? ? digitalWrite(LED_BUILTIN, LOW);
? ? delay(300);
? }
}
?
void loop() {
? if (isEthernetConnected) {
? ? if (!client.connected()) {
? ? ? client.stop();
? ? ? client = server.accept();
? ? ? if (client) {
? ? ? ? Serial.println("Client connected");
? ? ? }
? ? }
? }
?
? for (uint8_t i = 0; i < numReaders; i++) {
? ? if (readers[i].mfrc522.PICC_IsNewCardPresent() && readers[i].mfrc522.PICC_ReadCardSerial()) {
? ? ? for (uint8_t j = 0; j < readers[i].mfrc522.uid.size; j++) {
? ? ? ? readers[i].nuid[j] = readers[i].mfrc522.uid.uidByte[j];
? ? ? }
?
? ? ? byte checksum = readers[i].nuid[0];
? ? ? for (uint8_t j = 1; j < 5; j++) {
? ? ? ? checksum ^= readers[i].nuid[j];
? ? ? }
?
? ? ? // Send output to Serial connection
? ? ? Serial.write(readers[i].id);
?
? ? ? if (isEthernetConnected && client.connected()) {
? ? ? ? // Send output to Ethernet client
? ? ? ? client.write(readers[i].id);
? ? ? }
?
? ? ? for (uint8_t j = 0; j < 5; j++) {
? ? ? ? // Send output to Serial connection
? ? ? ? Serial.print(readers[i].nuid[j] < 0x10 ? "0" : "");
? ? ? ? Serial.print(readers[i].nuid[j], HEX);
?
? ? ? ? if (isEthernetConnected && client.connected()) {
? ? ? ? ? // Send output to Ethernet client
? ? ? ? ? client.print(readers[i].nuid[j] < 0x10 ? "0" : "");
? ? ? ? ? client.print(readers[i].nuid[j], HEX);
? ? ? ? }
? ? ? }
?
? ? ? // Send output to Serial connection
? ? ? Serial.print(checksum < 0x10 ? "0" : "");
? ? ? Serial.print(checksum, HEX);
?
? ? ? if (isEthernetConnected && client.connected()) {
? ? ? ? // Send output to Ethernet client
? ? ? ? client.print(checksum < 0x10 ? "0" : "");
? ? ? ? client.print(checksum, HEX);
? ? ? }
?
? ? ? // Send output to Serial connection
? ? ? Serial.write(0x0D);
? ? ? Serial.write(0x0A);
? ? ? Serial.write('>');
?
? ? ? if (isEthernetConnected && client.connected()) {
? ? ? ? // Send output to Ethernet client
? ? ? ? client.write(0x0D); // CR
? ? ? ? client.write(0x0A); // LF
? ? ? ? client.write('>');? // ETX replaced by '>'
? ? ? }
?
? ? ? readers[i].mfrc522.PICC_HaltA();
? ? ? readers[i].mfrc522.PCD_StopCrypto1();
? ? }
? }
} Tom |
Probably , all you can program is 1 thru 9. Try it, it will either work or it wont.
toggle quoted message
Show quoted text
Dave Hastings On Sunday, April 30, 2023 at 07:06:25 PM EDT, zzrguy <zzrguy1200@...> wrote:
One last question on this topic. It I program these decoders on a command 2000 can I use them on a JMRi or other system run layout? |
I’m a bit surprised that didn’t work. Let me do some experiments…
Bob On Apr 30, 2023, at 4:32 PM, Tim Kelley <tim.kelley@...> wrote:— Bob Jacobsen rgj1927@... |
MFRC522, Ethernet/Serial, Nano/Uno/Mega Ughhh! Disregard the last sketch I just posted. Use this one instead. Same functionality as described, but I inadvertently left out the IP address line(s). My apologies.? ? // Import Libraries
#include <SPI.h>? ? ? ? ? ?// SPI library for communicating with the MFRC522 reader
#include <MFRC522.h>? ? ? ?// MFRC522 library for reading RFID cards
#include <Ethernet.h>? ? ? // Ethernet library for the Ethernet shield
?
// Ethernet configuration
byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
IPAddress ip(192, 168, 1, 177); // Replace with the desired IP address
unsigned int serverPort = 8888;? // Replace with the desired port number
?
EthernetServer server(serverPort);
?
// Define the SS (Slave Select) and RST (Reset) pins for each reader
#if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO)
const uint8_t ssPins[] = {5, 6, 7, A0, A1, A2};
const uint8_t rstPins[] = {4, 8, 9, A3, A4, A5};
const uint8_t readerAssignment[] = {1, 2, 3, 4, 5, 6}; // Assign reader numbers based on SS and RST pins
#elif defined(ARDUINO_AVR_MEGA2560)
const uint8_t ssPins[] = {5, 6, 7, 8, 9, A0, A1, A2};
const uint8_t rstPins[] = {22, 23, 24, 25, 26, 27, 28, 29};
const uint8_t readerAssignment[] = {1, 2, 3, 4, 5, 6, 7, 8}; // Assign reader numbers based on SS and RST pins
#endif
?
const int numReaders = sizeof(ssPins) / sizeof(ssPins[0]);
const char readerID[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'};
?
struct RFIDReader {
? char id;
? uint8_t ssPin;
? uint8_t rstPin;
? MFRC522 mfrc522;
? byte nuid[7];
?
? RFIDReader() : id(0), ssPin(0), rstPin(0), mfrc522(MFRC522(0, 0)) {}
};
?
RFIDReader readers[numReaders];
EthernetClient client;
bool isEthernetConnected = false;
?
void setup() {
? Serial.begin(9600);
? SPI.begin();
? pinMode(10, OUTPUT);
? digitalWrite(10, HIGH);
?
? // Set pin 53 as OUTPUT for the Arduino Mega 2560
? #if defined(ARDUINO_AVR_MEGA2560)
? ? pinMode(53, OUTPUT);
? #endif
?
? pinMode(4, OUTPUT);
? digitalWrite(4, HIGH);
?
? if (Ethernet.begin(mac, ip) == 1) {
? ? isEthernetConnected = true;
? ? delay(1000);
? } else {
? ? Serial.println("Ethernet shield not connected or network not available");
? ? isEthernetConnected = false;
? }
?
? for (uint8_t i = 0; i < numReaders; i++) {
? ? readers[i].ssPin = ssPins[i];
? ? readers[i].rstPin = rstPins[i];
? ? readers[i].id = readerID[readerAssignment[i] - 1]; // Assign the reader ID based on readerAssignment array
? ? readers[i].mfrc522 = MFRC522(readers[i].ssPin, readers[i].rstPin);
? ? readers[i].mfrc522.PCD_Init();
? ? readers[i].mfrc522.PCD_SetAntennaGain(readers[i].mfrc522.RxGain_max);
?
? ? // Print debugging information
? ? Serial.print("Reader ");
? ? Serial.print(readers[i].id);
? ? Serial.print(" detected on SS pin ");
? ? Serial.println(readers[i].ssPin);
? }
?
? if (isEthernetConnected) {
? ? server.begin();
? }
?
? // Blink the LED to indicate the number of detected readers
? pinMode(LED_BUILTIN, OUTPUT);
? for (int i = 0; i < numReaders; i++) {
? ? digitalWrite(LED_BUILTIN, HIGH);
? ? delay(300);
? ? digitalWrite(LED_BUILTIN, LOW);
? ? delay(300);
? }
}
?
void loop() {
? if (isEthernetConnected) {
? ? if (!client.connected()) {
? ? ? client.stop();
? ? ? client = server.accept();
? ? ? if (client) {
? ? ? ? Serial.println("Client connected");
? ? ? }
? ? }
? }
?
? for (uint8_t i = 0; i < numReaders; i++) {
? ? if (readers[i].mfrc522.PICC_IsNewCardPresent() && readers[i].mfrc522.PICC_ReadCardSerial()) {
? ? ? for (uint8_t j = 0; j < readers[i].mfrc522.uid.size; j++) {
? ? ? ? readers[i].nuid[j] = readers[i].mfrc522.uid.uidByte[j];
? ? ? }
?
? ? ? byte checksum = readers[i].nuid[0];
? ? ? for (uint8_t j = 1; j < 5; j++) {
? ? ? ? checksum ^= readers[i].nuid[j];
? ? ? }
?
? ? ? // Send output to Serial connection
? ? ? Serial.write(readers[i].id);
?
? ? ? if (isEthernetConnected && client.connected()) {
? ? ? ? // Send output to Ethernet client
? ? ? ? client.write(readers[i].id);
? ? ? }
?
? ? ? for (uint8_t j = 0; j < 5; j++) {
? ? ? ? // Send output to Serial connection
? ? ? ? Serial.print(readers[i].nuid[j] < 0x10 ? "0" : "");
? ? ? ? Serial.print(readers[i].nuid[j], HEX);
?
? ? ? ? if (isEthernetConnected && client.connected()) {
? ? ? ? ? // Send output to Ethernet client
? ? ? ? ? client.print(readers[i].nuid[j] < 0x10 ? "0" : "");
? ? ? ? ? client.print(readers[i].nuid[j], HEX);
? ? ? ? }
? ? ? }
?
? ? ? // Send output to Serial connection
? ? ? Serial.print(checksum < 0x10 ? "0" : "");
? ? ? Serial.print(checksum, HEX);
?
? ? ? if (isEthernetConnected && client.connected()) {
? ? ? ? // Send output to Ethernet client
? ? ? ? client.print(checksum < 0x10 ? "0" : "");
? ? ? ? client.print(checksum, HEX);
? ? ? }
?
? ? ? // Send output to Serial connection
? ? ? Serial.write(0x0D);
? ? ? Serial.write(0x0A);
? ? ? Serial.write('>');
?
? ? ? if (isEthernetConnected && client.connected()) {
? ? ? ? // Send output to Ethernet client
? ? ? ? client.write(0x0D); // CR
? ? ? ? client.write(0x0A); // LF
? ? ? ? client.write('>');? // ETX replaced by '>'
? ? ? }
?
? ? ? readers[i].mfrc522.PICC_HaltA();
? ? ? readers[i].mfrc522.PCD_StopCrypto1();
? ? }
? }
} Tom |
to navigate to use esc to dismiss